]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
[RM-12259] Pass full distro module to uninstall()
authorTravis Rhoden <trhoden@redhat.com>
Wed, 15 Jul 2015 21:28:12 +0000 (21:28 +0000)
committerTravis Rhoden <trhoden@redhat.com>
Thu, 16 Jul 2015 01:30:36 +0000 (01:30 +0000)
Not having the distro modules be objects shows it's limitations
here, as there is no easy way for a module to reference itself.
Technically you could reference itself by name (e.g. have the
fedora module use ceph_deploy.hosts.fedora.packager), but that
is pretty ugly and continues to rely on global vars.

For now, just pass the full distro module instead of distro.conn
so that we can easily access distro.* attributes.

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

index 463892bcb79cca4526b25435ed0c427e1d61c2f6..6fdd9c63404b41ef0bf5ad0f09cd071e04b4e546 100644 (file)
@@ -1,7 +1,7 @@
 from ceph_deploy.util import pkg_managers
 
 
-def uninstall(conn, purge=False):
+def uninstall(distro, purge=False):
     packages = [
         'ceph',
         'ceph-release',
@@ -10,8 +10,8 @@ def uninstall(conn, purge=False):
         ]
 
     pkg_managers.yum_remove(
-        conn,
+        distro.conn,
         packages,
     )
 
-    pkg_managers.yum_clean(conn)
+    pkg_managers.yum_clean(distro.conn)
index ce2013f140a07a843e17ec5d80d9b7edcc012d31..6e55586322899516b6bc843c82374163eee7b1fd 100644 (file)
@@ -1,7 +1,7 @@
 from ceph_deploy.util import pkg_managers
 
 
-def uninstall(conn, purge=False):
+def uninstall(distro, purge=False):
     packages = [
         'ceph',
         'ceph-mds',
@@ -10,7 +10,7 @@ def uninstall(conn, purge=False):
         'radosgw',
         ]
     pkg_managers.apt_remove(
-        conn,
+        distro.conn,
         packages,
         purge=purge,
     )
index 1b032c8c973e53b8711a5a4f96cdd270030d4c0d..b70ac708c059c2aca40adff3df4dd7fe5fe535a4 100644 (file)
@@ -1,7 +1,7 @@
 from ceph_deploy.util import pkg_managers
 
 
-def uninstall(conn, purge=False):
+def uninstall(distro, purge=False):
     packages = [
         'ceph',
         'ceph-common',
@@ -9,7 +9,7 @@ def uninstall(conn, purge=False):
         ]
 
     pkg_managers.yum_remove(
-        conn,
+        distro.conn,
         packages,
     )
 
index 8660505f405b698d3a47ef8aae620fe9d95eb9c7..daf2cf6c0253e1a98ce51169b31db3960088fc9e 100644 (file)
@@ -1,7 +1,7 @@
 from ceph_deploy.util import pkg_managers
 
 
-def uninstall(conn, purge=False):
+def uninstall(distro, purge=False):
     packages = [
         'ceph',
         'ceph-common',
@@ -11,8 +11,8 @@ def uninstall(conn, purge=False):
         ]
 
     pkg_managers.yum_remove(
-        conn,
+        distro.conn,
         packages,
     )
 
-    pkg_managers.yum_clean(conn)
+    pkg_managers.yum_clean(distro.conn)
index fa85decf68feb02df748aa04dc86e8bb7907d63c..5128c09e3746289a63ddd7feafa21f9b71303243 100644 (file)
@@ -1,7 +1,7 @@
 from ceph_deploy.util import pkg_managers
 
 
-def uninstall(conn, purge=False):
+def uninstall(distro, purge=False):
     packages = [
         'ceph',
         'ceph-common',
@@ -10,4 +10,4 @@ def uninstall(conn, purge=False):
         'librbd1',
         'ceph-radosgw',
         ]
-    pkg_managers.zypper_remove(conn, packages)
+    pkg_managers.zypper_remove(distro.conn, packages)
index 19ccea8a0b1f52fd5d541be065dc28500da3c3f5..10cec3ba3ccce4f374e7c934006e6539203dba0f 100644 (file)
@@ -312,7 +312,7 @@ def uninstall(args):
         LOG.info('Distro info: %s %s %s', distro.name, distro.release, distro.codename)
         rlogger = logging.getLogger(hostname)
         rlogger.info('uninstalling ceph on %s' % hostname)
-        distro.uninstall(distro.conn)
+        distro.uninstall(distro)
         distro.conn.exit()
 
 
@@ -337,7 +337,7 @@ def purge(args):
         LOG.info('Distro info: %s %s %s', distro.name, distro.release, distro.codename)
         rlogger = logging.getLogger(hostname)
         rlogger.info('purging host ... %s' % hostname)
-        distro.uninstall(distro.conn, purge=True)
+        distro.uninstall(distro, purge=True)
         distro.conn.exit()