]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
if --repo is used return [], fallback to defaults when nothing is selected
authorAlfredo Deza <adeza@redhat.com>
Wed, 13 May 2015 18:15:19 +0000 (14:15 -0400)
committerAlfredo Deza <adeza@redhat.com>
Wed, 13 May 2015 18:15:19 +0000 (14:15 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
ceph_deploy/install.py

index 5a9a5f6eb4d12cd54d4de6ab43c2fa36b2cf6668..32b869e0d82c95f05b22f0ff92120503fa302609 100644 (file)
@@ -42,6 +42,13 @@ def detect_components(args, distro):
     these flags and return the default if none are passed in (which is, install
     everything)
     """
+    # the flag that prevents all logic here is the `--repo` flag which is used
+    # when no packages should be installed, just the repo files, so check for
+    # that here and return an empty list (which is equivalent to say 'no
+    # packages should be installed')
+    if args.repo:
+        return []
+
     flags = {
         'install_osd': 'ceph-osd',
         'install_rgw': 'ceph-radosgw',
@@ -63,7 +70,10 @@ def detect_components(args, distro):
         for k, v in flags.items():
             if getattr(args, k, False):
                 components.append(v)
-        return components
+        # if we have some components selected from flags then return that,
+        # otherwise return defaults because no flags and no `--repo` means we
+        # should get all of them by default
+        return components or defaults
 
 
 def install(args):