return 1
-def update_partition(action, dev, description):
- # 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 %s device %s', description, dev)
- LOG.info('re-reading known partitions will display errors')
- command(
- [
- 'partx',
- action,
- dev,
- ],
- )
-
- else:
- LOG.debug('Calling partprobe on %s device %s', description, dev)
- command(
- [
- 'partprobe',
- dev,
- ],
- )
+def update_partition(dev, description):
+ LOG.debug('Calling partprobe on %s device %s', description, dev)
+ command(
+ [
+ 'partprobe',
+ dev,
+ ],
+ )
def zap(dev):
],
)
- update_partition('-d', dev, 'zapped')
+ update_partition(dev, 'zapped')
except subprocess.CalledProcessError as e:
raise Error(e)
]
)
- update_partition('-a', journal, 'prepared')
+ update_partition(journal, 'prepared')
# wait for udev event queue to clear
command(
data,
],
)
- update_partition('-a', data, 'created')
+ update_partition(data, 'created')
command(
[
# wait for udev event queue to clear
prepare_lock.release() # noqa
if stat.S_ISBLK(dmode):
- update_partition('-a', args.data, 'prepared')
+ update_partition(args.data, 'prepared')
except Error as e:
if journal_dm_keypath: