From 1c647b410e1024732be0385b95a2ff9afb1a93d1 Mon Sep 17 00:00:00 2001 From: Travis Rhoden Date: Thu, 9 Jul 2015 17:09:29 -0700 Subject: [PATCH] [RM-12147] Put repo mod flags in a mutex --adjust-repos and --no-adjust-repos were not in a mutex group. Fix that. Also --repo will always install a new repo file, regardless of --[no]-adjust-repos, so it might as well be in the same mutex group. Signed-off-by: Travis Rhoden --- ceph_deploy/install.py | 15 ++++++++++----- ceph_deploy/tests/parser/test_install.py | 2 -- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ceph_deploy/install.py b/ceph_deploy/install.py index 7081ab8..19ccea8 100644 --- a/ceph_deploy/install.py +++ b/ceph_deploy/install.py @@ -528,25 +528,31 @@ def make(parser): help='install all ceph components (e.g. mon,osd,mds,rgw). This is the default', ) - parser.add_argument( + repo = parser.add_mutually_exclusive_group() + + repo.add_argument( '--adjust-repos', dest='adjust_repos', action='store_true', help='install packages modifying source repos', ) - parser.add_argument( + repo.add_argument( '--no-adjust-repos', dest='adjust_repos', action='store_false', help='install packages without modifying source repos', ) - parser.add_argument( + repo.add_argument( '--repo', action='store_true', help='install repo files only (skips package installation)', - ) + ) + + repo.set_defaults( + adjust_repos=True, + ) parser.add_argument( 'host', @@ -580,7 +586,6 @@ def make(parser): parser.set_defaults( func=install, - adjust_repos=True, ) diff --git a/ceph_deploy/tests/parser/test_install.py b/ceph_deploy/tests/parser/test_install.py index df94de5..190a984 100644 --- a/ceph_deploy/tests/parser/test_install.py +++ b/ceph_deploy/tests/parser/test_install.py @@ -106,7 +106,6 @@ class TestParserInstall(object): args = self.parser.parse_args(('install --%s host1' % comp).split()) assert getattr(args, 'install_%s' % comp) is True - @pytest.mark.skipif(reason="http://tracker.ceph.com/issues/12147") def test_install_multi_component(self): args = self.parser.parse_args(('install --mon --rgw host1').split()) assert args.install_mon @@ -120,7 +119,6 @@ class TestParserInstall(object): args = self.parser.parse_args('install --no-adjust-repos host1'.split()) assert not args.adjust_repos - @pytest.mark.skipif(reason="http://tracker.ceph.com/issues/12147") def test_install_adjust_repos_false_with_custom_release(self): args = self.parser.parse_args('install --release firefly --no-adjust-repos host1'.split()) assert args.release == "firefly" -- 2.47.3