def parseoptions(module, options):
 options_dict = keydict()
 if options:
  regex = re.compile('((?:[^,"\']|"[^"]*"|\'[^\']*\')+)')
  parts = regex.split(options)[1:(-1)]
  for part in parts:
   if ('=' in part):
    (key, value) = part.split('=', 1)
    options_dict[key] = value
   elif (part != ','):
    options_dict[part] = None
 return options_dict

def parseoptions ( module , options ) : options_dict = keydict ( ) if options : regex = re . compile ( '((?:[^,"\']|"[^"]*"|\'[^\']*\')+)' ) parts = regex . split ( options ) [ 1 : ( - 1 ) ] for part in parts : if ( '=' in part ) : ( key , value ) = part . split ( '=' , 1 ) options_dict [ key ] = value elif ( part != ',' ) : options_dict [ part ] = None return options_dict
reads a string containing ssh-key options and returns a dictionary of those options .