From: Alfredo Deza Date: Wed, 13 May 2015 18:15:19 +0000 (-0400) Subject: if --repo is used return [], fallback to defaults when nothing is selected X-Git-Tag: v1.5.24~7^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e1634c5be9bd6aef1896237341ab6db30dbb6222;p=ceph-deploy.git if --repo is used return [], fallback to defaults when nothing is selected Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/install.py b/ceph_deploy/install.py index 5a9a5f6..32b869e 100644 --- a/ceph_deploy/install.py +++ b/ceph_deploy/install.py @@ -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):