def install_epel(distro): """ CentOS and Scientific need the EPEL repo, otherwise Ceph cannot be installed. """ if distro.name.lower() in ['centos', 'scientific']: distro.conn.logger.info('adding EPEL repository') if float(distro.release) >= 6: remoto.process.run( distro.conn, ['wget', 'http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm'], ) pkg_managers.rpm( distro.conn, [ '--replacepkgs', 'epel-release-6*.rpm', ], ) else: remoto.process.run( distro.conn, ['wget', 'http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm'], ) pkg_managers.rpm( distro.conn, [ '--replacepkgs', 'epel-release-5*.rpm' ], )
def install_epel(distro): """ CentOS and Scientific need the EPEL repo, otherwise Ceph cannot be installed. """ if distro.name.lower() in ['centos', 'scientific']: distro.conn.logger.info('adding EPEL repository') if float(distro.release) >= 6: process.run( distro.conn, ['wget', 'http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm'], ) pkg_managers.rpm( distro.conn, [ '--replacepkgs', 'epel-release-6*.rpm', ], ) else: process.run( distro.conn, ['wget', 'wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm'], ) pkg_managers.rpm( distro.conn, [ '--replacepkgs', 'epel-release-5*.rpm' ], )
def test_extended_flags(self): fake_run = Mock() with patch(self.to_patch, fake_run): pkg_managers.rpm( Mock(), ['-f', 'vim']) result = fake_run.call_args_list[-1] assert result[0][-1] == ['rpm', '-Uvh', '-f', 'vim']
def install_epel(distro): """ CentOS and Scientific need the EPEL repo, otherwise Ceph cannot be installed. """ if distro.name.lower() in ["centos", "scientific"]: distro.conn.logger.info("adding EPEL repository") if float(distro.release) >= 6: remoto.process.run( distro.conn, ["wget", "http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm"] ) pkg_managers.rpm(distro.conn, ["--replacepkgs", "epel-release-6*.rpm"]) else: remoto.process.run( distro.conn, ["wget", "http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm"] ) pkg_managers.rpm(distro.conn, ["--replacepkgs", "epel-release-5*.rpm"])
def install_epel(distro, logger): """ CentOS and Scientific need the EPEL repo, otherwise Ceph cannot be installed. """ if distro.name.lower() in ['centos', 'scientific']: logger.info('adding EPEL repository') if float(distro.release) >= 6: check_call( distro.sudo_conn, logger, ['wget', 'http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm'], stop_on_error=False, ) pkg_managers.rpm( distro.sudo_conn, logger, [ '--replacepkgs', 'epel-release-6*.rpm', ], stop_on_error=False, ) else: check_call( distro.sudo_conn, logger, ['wget', 'wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm'], stop_on_error=False, ) pkg_managers.rpm( distro.sudo_conn, logger, [ '--replacepkgs', 'epel-release-5*.rpm' ], stop_on_error=False, )
def test_normal_flags(self): fake_run = Mock() with patch(self.to_patch, fake_run): pkg_managers.rpm(Mock()) result = fake_run.call_args_list[-1] assert result[0][-1] == ['rpm', '-Uvh']