def lv_check(vg_name, lv_name):
 cmd = 'lvdisplay'
 result = utils.run(cmd, ignore_status=True)
 lvpattern = ('LV Path\\s+/dev/%s/%s\\s+' % (vg_name, lv_name))
 match = re.search(lvpattern, result.stdout.rstrip())
 if match:
  logging.debug('Provided logical volume %s exists in %s', lv_name, vg_name)
  return True
 else:
  return False

def lv_check ( vg_name , lv_name ) : cmd = 'lvdisplay' result = utils . run ( cmd , ignore_status = True ) lvpattern = ( 'LV Path\\s+/dev/%s/%s\\s+' % ( vg_name , lv_name ) ) match = re . search ( lvpattern , result . stdout . rstrip ( ) ) if match : logging . debug ( 'Provided logical volume %s exists in %s' , lv_name , vg_name ) return True else : return False
check whether provided logical volume exists .