From 58aa02d706c9bea23e08833c3947265041d3bab0 Mon Sep 17 00:00:00 2001 From: Ryan Leimenstoll Date: Thu, 1 Feb 2018 10:55:52 -0500 Subject: [PATCH] [RM-22871] add debug arg to parser for disk zap Signed-off-by: Ryan Leimenstoll --- ceph_deploy/osd.py | 5 +++++ ceph_deploy/tests/parser/test_disk.py | 14 ++++++++++++++ 2 files changed, 19 insertions(+) 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 -- 2.47.3