def lv_list():
 cmd = 'lvs --all'
 volumes = {}
 result = utils.run(cmd)
 lines = result.stdout.strip().splitlines()
 if (len(lines) > 1):
  columns = lines[0].split()
  lines = lines[1:]
 else:
  return volumes
 for line in lines:
  details = line.split()
  length = len(details)
  details_dict = {}
  lv_name = details[0]
  details_dict['VG'] = details[1]
  details_dict['Attr'] = details[2]
  details_dict['LSize'] = details[3]
  if (length == 5):
   details_dict['Origin_Data'] = details[4]
  elif (length > 5):
   details_dict['Origin_Data'] = details[5]
   details_dict['Pool'] = details[4]
  volumes[lv_name] = details_dict
 return volumes

def lv_list ( ) : cmd = 'lvs --all' volumes = { } result = utils . run ( cmd ) lines = result . stdout . strip ( ) . splitlines ( ) if ( len ( lines ) > 1 ) : columns = lines [ 0 ] . split ( ) lines = lines [ 1 : ] else : return volumes for line in lines : details = line . split ( ) length = len ( details ) details_dict = { } lv_name = details [ 0 ] details_dict [ 'VG' ] = details [ 1 ] details_dict [ 'Attr' ] = details [ 2 ] details_dict [ 'LSize' ] = details [ 3 ] if ( length == 5 ) : details_dict [ 'Origin_Data' ] = details [ 4 ] elif ( length > 5 ) : details_dict [ 'Origin_Data' ] = details [ 5 ] details_dict [ 'Pool' ] = details [ 4 ] volumes [ lv_name ] = details_dict return volumes
list available group volumes .