@error.context_aware
def lv_reactivate(vg_name, lv_name, timeout=10):
 try:
  utils.run(('lvchange -an /dev/%s/%s' % (vg_name, lv_name)))
  time.sleep(timeout)
  utils.run(('lvchange -ay /dev/%s/%s' % (vg_name, lv_name)))
  time.sleep(timeout)
 except error.CmdError:
  logging.error(('Failed to reactivate %s - please, ' + 'nuke the process that uses it first.'), lv_name)
  raise error.TestError(('The logical volume %s is still active' % lv_name))

@ error . context_aware def lv_reactivate ( vg_name , lv_name , timeout = 10 ) : try : utils . run ( ( 'lvchange -an /dev/%s/%s' % ( vg_name , lv_name ) ) ) time . sleep ( timeout ) utils . run ( ( 'lvchange -ay /dev/%s/%s' % ( vg_name , lv_name ) ) ) time . sleep ( timeout ) except error . CmdError : logging . error ( ( 'Failed to reactivate %s - please, ' + 'nuke the process that uses it first.' ) , lv_name ) raise error . TestError ( ( 'The logical volume %s is still active' % lv_name ) )
in case of unclean shutdowns some of the lvs is still active and merging is postponed .