]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: use update_partition in prepare_dev and main_prepare
authorLoic Dachary <loic-201408@dachary.org>
Fri, 10 Oct 2014 08:26:31 +0000 (10:26 +0200)
committerLoic Dachary <ldachary@redhat.com>
Tue, 18 Nov 2014 11:20:01 +0000 (12:20 +0100)
In the case of prepare_dev the partx alternative was missing and is not
added because update_partition does it.

http://tracker.ceph.com/issues/9721 Fixes: #9721

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
src/ceph-disk

index 8954175d52db4f877b65e31ae169393ce9ab05e0..0334c92b5fa452d187411a0db8fd65cba1f558c3 100755 (executable)
@@ -1311,12 +1311,7 @@ def prepare_dev(
                     data,
                 ],
             )
-            command(
-                [
-                    'partprobe',
-                    data,
-                    ],
-                )
+            update_partition('-a', data, 'created')
             command(
                 [
                     # wait for udev event queue to clear
@@ -1533,33 +1528,7 @@ def main_prepare(args):
         prepare_lock.release()  # noqa
 
         if stat.S_ISBLK(dmode):
-            # try to make sure the kernel refreshes the table.  note
-            # that if this gets ebusy, we are probably racing with
-            # udev because it already updated it.. ignore failure here.
-
-            # On RHEL and CentOS distros, calling partprobe forces a reboot of
-            # the server. Since we are not resizing partitons so we rely on
-            # calling partx
-            if platform_distro().startswith(('centos', 'red', 'scientific')):
-                LOG.info('calling partx on prepared device %s', args.data)
-                LOG.info('re-reading known partitions will display errors')
-
-                command(
-                    [
-                        'partx',
-                        '-a',
-                        args.data,
-                        ],
-                    )
-
-            else:
-                LOG.debug('Calling partprobe on prepared device %s', args.data)
-                command(
-                    [
-                        'partprobe',
-                        args.data,
-                        ],
-                    )
+            update_partition('-a', args.data, 'prepared')
 
     except Error as e:
         if journal_dm_keypath: