]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
[RM-22871] add debug arg to parser for disk zap 464/head
authorRyan Leimenstoll <rleimens@umiacs.umd.edu>
Thu, 1 Feb 2018 15:55:52 +0000 (10:55 -0500)
committerRyan Leimenstoll <rleimens@umiacs.umd.edu>
Thu, 1 Feb 2018 15:55:52 +0000 (10:55 -0500)
Signed-off-by: Ryan Leimenstoll <rleimens@umiacs.umd.edu>
ceph_deploy/osd.py
ceph_deploy/tests/parser/test_disk.py

index b2340e2a9ebea5369949c06409c916b1bb45dbc0..634b59be05c0f6e3cf37911b62422975a6cf9c0c 100644 (file)
@@ -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)'
index 02c11ab8213a12f1b73601dfa765db6987d50cbc..cedd858e0134d8b20ac28b042262a7a68ebcb8da 100644 (file)
@@ -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