mirror of
https://github.com/ceph/ceph
synced 2024-12-18 17:37:38 +00:00
ceph-disk: use update_partition in prepare_dev and main_prepare
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>
This commit is contained in:
parent
922a15ea68
commit
23e71b1ee8
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user