# wait for udev event queue to clear
'udevadm',
'settle',
- '--timeout=10',
- ],
- )
- subprocess.check_call(
- args=[
- # also make sure the kernel refreshes the new table
- 'partprobe',
- journal,
],
)
# wait for udev event queue to clear
'udevadm',
'settle',
- '--timeout=10',
- ],
- )
- subprocess.check_call(
- args=[
- # also make sure the kernel refreshes the new table
- 'partprobe',
- data,
],
)
except subprocess.CalledProcessError as e:
data,
],
)
- subprocess.call(
- args=[
- # wait for udev event queue to clear
- 'udevadm',
- 'settle',
- '--timeout=10',
- ],
- )
- subprocess.check_call(
- args=[
- # also make sure the kernel refreshes the new table
- 'partprobe',
- data,
- ],
- )
except subprocess.CalledProcessError as e:
raise Error(e)
raise Error('not a dir or block device', args.data)
prepare_lock.release()
+ 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.
+ LOG.debug('Calling partprobe on prepared device %s', args.data)
+ subprocess.call(
+ args=[
+ 'partprobe',
+ args.data,
+ ],
+ )
+
+
except Error as e:
if journal_dm_keypath:
os.unlink(journal_dm_keypath)