def _parse_fmadm_config(output):
 result = []
 output = output.split('\n')
 header = [field for field in output[0].lower().split(' ') if field]
 del output[0]
 for entry in output:
  entry = [item for item in entry.split(' ') if item]
  entry = (entry[0:3] + [' '.join(entry[3:])])
  component = OrderedDict()
  for field in header:
   component[field] = entry[header.index(field)]
  result.append(component)
 keyed_result = OrderedDict()
 for component in result:
  keyed_result[component['module']] = component
  del keyed_result[component['module']]['module']
 result = keyed_result
 return result

def _parse_fmadm_config ( output ) : result = [ ] output = output . split ( '\n' ) header = [ field for field in output [ 0 ] . lower ( ) . split ( ' ' ) if field ] del output [ 0 ] for entry in output : entry = [ item for item in entry . split ( ' ' ) if item ] entry = ( entry [ 0 : 3 ] + [ ' ' . join ( entry [ 3 : ] ) ] ) component = OrderedDict ( ) for field in header : component [ field ] = entry [ header . index ( field ) ] result . append ( component ) keyed_result = OrderedDict ( ) for component in result : keyed_result [ component [ 'module' ] ] = component del keyed_result [ component [ 'module' ] ] [ 'module' ] result = keyed_result return result
parsbb fmdump/fmadm output .