From: Ryan Leimenstoll Date: Thu, 1 Feb 2018 15:55:52 +0000 (-0500) Subject: [RM-22871] add debug arg to parser for disk zap X-Git-Tag: v2.0.1~10^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F464%2Fhead;p=ceph-deploy.git [RM-22871] add debug arg to parser for disk zap Signed-off-by: Ryan Leimenstoll --- diff --git a/ceph_deploy/osd.py b/ceph_deploy/osd.py index b2340e2..634b59b 100644 --- a/ceph_deploy/osd.py +++ b/ceph_deploy/osd.py @@ -585,6 +585,11 @@ def make_disk(parser): metavar='DISK', help='Disk(s) to zap' ) + disk_zap.add_argument( + '--debug', + action='store_true', + help='Enable debug mode on remote ceph-volume calls', + ) disk_list = disk_parser.add_parser( 'list', help='List disk info from remote host(s)' diff --git a/ceph_deploy/tests/parser/test_disk.py b/ceph_deploy/tests/parser/test_disk.py index 02c11ab..cedd858 100644 --- a/ceph_deploy/tests/parser/test_disk.py +++ b/ceph_deploy/tests/parser/test_disk.py @@ -44,6 +44,12 @@ class TestParserDisk(object): def test_disk_list_single_host(self): args = self.parser.parse_args('disk list host1'.split()) assert args.host[0] == 'host1' + assert args.debug is False + + def test_disk_list_single_host_debug(self): + args = self.parser.parse_args('disk list --debug host1'.split()) + assert args.host[0] == 'host1' + assert args.debug is True def test_disk_list_multi_host(self): hostnames = ['host1', 'host2', 'host3'] @@ -66,9 +72,17 @@ class TestParserDisk(object): args = self.parser.parse_args('disk zap host1 /dev/sdb'.split()) assert args.disk[0] == '/dev/sdb' assert args.host == 'host1' + assert args.debug is False def test_disk_zap_multi_host(self): host = 'host1' disks = ['/dev/sda1', '/dev/sda2'] args = self.parser.parse_args(['disk', 'zap', host] + disks) assert args.disk == disks + + def test_disk_zap_debug_true(self): + args = \ + self.parser.parse_args('disk zap --debug host1 /dev/sdb'.split()) + assert args.disk[0] == '/dev/sdb' + assert args.host == 'host1' + assert args.debug is True