def _xr_to_keyset(line):
 tkns = [elm for elm in line.strip().split(':', 1) if elm]
 if (len(tkns) == 1):
  return "'{0}': ".format(tkns[0])
 else:
  (key, val) = tkns
  return "'{0}': '{1}',".format(key.strip(), val.strip())

def _xr_to_keyset ( line ) : tkns = [ elm for elm in line . strip ( ) . split ( ':' , 1 ) if elm ] if ( len ( tkns ) == 1 ) : return "'{0}': " . format ( tkns [ 0 ] ) else : ( key , val ) = tkns return "'{0}': '{1}'," . format ( key . strip ( ) , val . strip ( ) )
parse xfsrestore output keyset elements .