]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ceph-disk: remove try/except for CalledProcessError to use new exit flag handler
authorAlfredo Deza <adeza@redhat.com>
Fri, 3 Jun 2016 15:43:26 +0000 (11:43 -0400)
committerAlfredo Deza <adeza@redhat.com>
Fri, 9 Dec 2016 12:52:25 +0000 (07:52 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-disk/ceph_disk/main.py

index d2d8d230853607f1779f27504bed57865a5c4779..7cc49385de1922835d68bb5302283a6570a08f43 100755 (executable)
@@ -1575,7 +1575,8 @@ class Device(object):
                 '--mbrtogpt',
                 '--',
                 self.path,
-            ]
+            ],
+            exit=True
         )
         update_partition(self.path, 'created')
         return num
@@ -2727,12 +2728,9 @@ class PrepareData(object):
                 '--',
                 partition.get_dev(),
             ])
-            try:
-                LOG.debug('Creating %s fs on %s',
-                          self.args.fs_type, partition.get_dev())
-                command_check_call(args)
-            except subprocess.CalledProcessError as e:
-                raise Error(e)
+            LOG.debug('Creating %s fs on %s',
+                      self.args.fs_type, partition.get_dev())
+            command_check_call(args, exit=True)
 
             path = mount(dev=partition.get_dev(),
                          fstype=self.args.fs_type,
@@ -2748,18 +2746,16 @@ class PrepareData(object):
                 partition.unmap()
 
         if not is_partition(self.args.data):
-            try:
-                command_check_call(
-                    [
-                        'sgdisk',
-                        '--typecode=%d:%s' % (partition.get_partition_number(),
-                                              partition.ptype_for_name('osd')),
-                        '--',
-                        self.args.data,
-                    ],
-                )
-            except subprocess.CalledProcessError as e:
-                raise Error(e)
+            command_check_call(
+                [
+                    'sgdisk',
+                    '--typecode=%d:%s' % (partition.get_partition_number(),
+                                          partition.ptype_for_name('osd')),
+                    '--',
+                    self.args.data,
+                ],
+                exit=True,
+            )
             update_partition(self.args.data, 'prepared')
             command_check_call(['udevadm', 'trigger',
                                 '--action=add',