]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
[RM-12543] debian: only install requested packages
authorTravis Rhoden <trhoden@redhat.com>
Fri, 31 Jul 2015 18:56:39 +0000 (11:56 -0700)
committerTravis Rhoden <trhoden@redhat.com>
Mon, 3 Aug 2015 20:16:33 +0000 (13:16 -0700)
Refs: #12543

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

index 3d0282435a809c1ba8bcba2ea799b4ddc45ef9e1..69447582cad706b419f39c53f1865d77f596f0fe 100644 (file)
@@ -3,11 +3,17 @@ from urlparse import urlparse
 from ceph_deploy.lib import remoto
 from ceph_deploy.util import pkg_managers
 from ceph_deploy.util.paths import gpg
+from ceph_deploy.hosts.common import map_components
+
+
+NON_SPLIT_COMPONENTS = ['ceph-osd', 'ceph-mon']
 
 
 def install(distro, version_kind, version, adjust_repos, **kw):
-    # note: when split packages for ceph land for Debian/Ubuntu,
-    # `kw['components']` will have those. Unused for now.
+    packages = map_components(
+        NON_SPLIT_COMPONENTS,
+        kw.pop('components', [])
+    )
     codename = distro.codename
     machine = distro.machine_type
 
@@ -81,9 +87,8 @@ def install(distro, version_kind, version, adjust_repos, **kw):
         )
 
     # TODO this does not downgrade -- should it?
-    remoto.process.run(
-        distro.conn,
-        [
+    if len(packages):
+        cmd = [
             'env',
             'DEBIAN_FRONTEND=noninteractive',
             'DEBIAN_PRIORITY=critical',
@@ -94,18 +99,19 @@ def install(distro, version_kind, version, adjust_repos, **kw):
             '--assume-yes',
             'install',
             '--',
-            'ceph',
-            'ceph-mds',
-            'ceph-common',
-            'ceph-fs-common',
-            'radosgw',
-            ],
+        ]
+        cmd.extend(packages)
+        remoto.process.run(
+            distro.conn,
+            cmd
         )
 
 
 def mirror_install(distro, repo_url, gpg_url, adjust_repos, **kw):
-    # note: when split packages for ceph land for Debian/Ubuntu,
-    # `kw['components']` will have those. Unused for now.
+    packages = map_components(
+        NON_SPLIT_COMPONENTS,
+        kw.pop('components', [])
+    )
     repo_url = repo_url.strip('/')  # Remove trailing slashes
     gpg_path = gpg_url.split('file://')[-1]
 
@@ -139,23 +145,14 @@ def mirror_install(distro, repo_url, gpg_url, adjust_repos, **kw):
         distro.conn.remote_module.write_sources_list(repo_url, distro.codename)
 
     pkg_managers.apt_update(distro.conn)
-    packages = (
-        'ceph',
-        'ceph-mds',
-        'ceph-common',
-        'ceph-fs-common',
-    )
-
     pkg_managers.apt(distro.conn, packages)
-    pkg_managers.apt(distro.conn, 'ceph')
 
 
 def repo_install(distro, repo_name, baseurl, gpgkey, **kw):
-    # do we have specific components to install?
-    # removed them from `kw` so that we don't mess with other defaults
-    # note: when split packages for ceph land for Debian/Ubuntu, `packages`
-    # can be used. Unused for now.
-    packages = kw.pop('components', [])
+    packages = map_components(
+        NON_SPLIT_COMPONENTS,
+        kw.pop('components', [])
+    )
     # Get some defaults
     safe_filename = '%s.list' % repo_name.replace(' ', '-')
     install_ceph = kw.pop('install_ceph', False)
@@ -196,13 +193,4 @@ def repo_install(distro, repo_name, baseurl, gpgkey, **kw):
     pkg_managers.apt_update(distro.conn)
 
     if install_ceph:
-        # Before any install, make sure we have `wget`
-        packages = (
-            'ceph',
-            'ceph-mds',
-            'ceph-common',
-            'ceph-fs-common',
-        )
-
         pkg_managers.apt(distro.conn, packages)
-        pkg_managers.apt(distro.conn, 'ceph')