parameters: (vgname=None)
return_statement: return map(
          lambda l: {'lvname': l[0], 'path': l[1], 'size': int(l[2])},
          [fields.split() for fields in lvs],
      )
docstring: lists all logical volumes found in the system. It can be filtered by
      the volume group. All size units are in bytes.
  
      [{'lvname': 'lva', 'path': '/dev/vgtest/lva', 'size': 12345L},
       {'lvname': 'lvb', 'path': '/dev/vgtest/lvb', 'size': 12345L}]
docstring_summary: lists all logical volumes found in the system. It can be filtered by
      the volume group. All size units are in bytes.
docstring_tokens: lists all logical volumes found in the system . It can be filtered by the volume group . All size units are in bytes .
function: def lvs(vgname=None):
      """
      lists all logical volumes found in the system. It can be filtered by
      the volume group. All size units are in bytes.
  
      [{'lvname': 'lva', 'path': '/dev/vgtest/lva', 'size': 12345L},
       {'lvname': 'lvb', 'path': '/dev/vgtest/lvb', 'size': 12345L}]
      """
      cmd = [
          'lvs',
          '--units',
          'b',
          '--nosuffix',
          '--noheading',
          '--unbuffered',
          '--options',
          'lv_name,lv_path,lv_size,vg_name',
      ]
  
      out, err, rc = run_command(cmd)
      if rc != 0:
          raise OperationFailed('KCHDISK00004E', {'err': err})
  
      if not out:
          return []
  
      # remove blank spaces and create a list of LVs filtered by vgname, if
      # provided
      lvs = filter(
          lambda f: vgname is None or vgname in f,
          map(lambda v: v.strip(), out.strip('\n').split('\n')),
      )
  
      # create a dict based on data retrieved from lvs
      return map(
          lambda l: {'lvname': l[0], 'path': l[1], 'size': int(l[2])},
          [fields.split() for fields in lvs],
      )
function_tokens: def lvs ( vgname = None ) : cmd = [ 'lvs' , '--units' , 'b' , '--nosuffix' , '--noheading' , '--unbuffered' , '--options' , 'lv_name,lv_path,lv_size,vg_name' , ] out , err , rc = run_command ( cmd ) if rc != 0 : raise OperationFailed ( 'KCHDISK00004E' , { 'err' : err } ) if not out : return [ ] # remove blank spaces and create a list of LVs filtered by vgname, if # provided lvs = filter ( lambda f : vgname is None or vgname in f , map ( lambda v : v . strip ( ) , out . strip ( '\n' ) . split ( '\n' ) ) , ) # create a dict based on data retrieved from lvs return map ( lambda l : { 'lvname' : l [ 0 ] , 'path' : l [ 1 ] , 'size' : int ( l [ 2 ] ) } , [ fields . split ( ) for fields in lvs ] , )