]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
[RM-12439] rhel: use Yum Class package manager
authorTravis Rhoden <trhoden@redhat.com>
Fri, 31 Jul 2015 22:55:38 +0000 (15:55 -0700)
committerTravis Rhoden <trhoden@redhat.com>
Mon, 3 Aug 2015 22:55:15 +0000 (15:55 -0700)
Refs: #12439

Signed-off-by: Travis Rhoden <trhoden@redhat.com>
ceph_deploy/hosts/__init__.py
ceph_deploy/hosts/rhel/__init__.py
ceph_deploy/hosts/rhel/install.py
ceph_deploy/hosts/rhel/uninstall.py

index bc73c25d11220bec871556f962c338f6974baa33..e725882c39c1d69d47afa676ff79a0cf822f713d 100644 (file)
@@ -69,7 +69,7 @@ def get(hostname,
     module.conn = conn
     module.machine_type = machine_type
     module.init = module.choose_init()
-    if module.normalized_name in ['fedora', 'centos']:
+    if module.normalized_name in ['fedora', 'centos', 'redhat']:
         module.packager = module.get_packager(module)
     return module
 
index 13f7b22331b9d2f84a2da7b82ea0d6757ea4c794..c866247ba5905f421071182cab549778827c77e6 100644 (file)
@@ -2,6 +2,7 @@ import mon  # noqa
 import pkg  # noqa
 from install import install, mirror_install, repo_install  # noqa
 from uninstall import uninstall  # noqa
+from ceph_deploy.util import pkg_managers
 
 # Allow to set some information about this distro
 #
@@ -17,3 +18,7 @@ def choose_init():
     Returns the name of a init system (upstart, sysvinit ...).
     """
     return 'sysvinit'
+
+
+def get_packager(module):
+    return pkg_managers.Yum(module)
index 9a44cdd4b1be0fd90b6ad6a9ff2870f3356247cb..a8abdd00affc57f0e1b92954628054e7b4eca3b0 100644 (file)
@@ -1,11 +1,11 @@
-from ceph_deploy.util import pkg_managers, templates
+from ceph_deploy.util import templates
 from ceph_deploy.lib import remoto
 
 
 def install(distro, version_kind, version, adjust_repos, **kw):
     packages = kw.get('components', [])
-    pkg_managers.yum_clean(distro.conn)
-    pkg_managers.yum(distro.conn, packages)
+    distro.packager.clean()
+    distro.packager.install(packages)
 
 
 def mirror_install(distro, repo_url,
@@ -14,7 +14,7 @@ def mirror_install(distro, repo_url,
     repo_url = repo_url.strip('/')  # Remove trailing slashes
     gpg_url_path = gpg_url.split('file://')[-1]  # Remove file if present
 
-    pkg_managers.yum_clean(distro.conn)
+    distro.packager.clean()
 
     if adjust_repos:
         remoto.process.run(
@@ -33,8 +33,8 @@ def mirror_install(distro, repo_url,
 
         distro.conn.remote_module.write_yum_repo(ceph_repo_content)
 
-    if extra_installs:
-        pkg_managers.yum(distro.conn, packages)
+    if extra_installs and packages:
+        distro.packager.install(packages)
 
 
 def repo_install(distro, reponame, baseurl, gpgkey, **kw):
@@ -51,7 +51,7 @@ def repo_install(distro, reponame, baseurl, gpgkey, **kw):
     _type = 'repo-md'
     baseurl = baseurl.strip('/')  # Remove trailing slashes
 
-    pkg_managers.yum_clean(distro.conn)
+    distro.packager.clean()
 
     if gpgkey:
         remoto.process.run(
@@ -81,5 +81,5 @@ def repo_install(distro, reponame, baseurl, gpgkey, **kw):
     )
 
     # Some custom repos do not need to install ceph
-    if install_ceph:
-        pkg_managers.yum(distro.conn, packages)
+    if install_ceph and packages:
+        distro.packager.install(packages)
index daf2cf6c0253e1a98ce51169b31db3960088fc9e..17ae208ff568797750bffc29806695029ab95418 100644 (file)
@@ -1,6 +1,3 @@
-from ceph_deploy.util import pkg_managers
-
-
 def uninstall(distro, purge=False):
     packages = [
         'ceph',
@@ -10,9 +7,5 @@ def uninstall(distro, purge=False):
         'ceph-radosgw'
         ]
 
-    pkg_managers.yum_remove(
-        distro.conn,
-        packages,
-    )
-
-    pkg_managers.yum_clean(distro.conn)
+    distro.packager.remove(packages)
+    distro.packager.clean()