def _parse_vmconfig(config, instances):
 vmconfig = None
 if isinstance(config, salt.utils.odict.OrderedDict):
  vmconfig = OrderedDict()
  for prop in config.keys():
   if (prop not in instances):
    vmconfig[prop] = config[prop]
   else:
    if (not isinstance(config[prop], salt.utils.odict.OrderedDict)):
     continue
    vmconfig[prop] = []
    for instance in config[prop]:
     instance_config = config[prop][instance]
     instance_config[instances[prop]] = instance
     vmconfig[prop].append(instance_config)
 else:
  log.error('smartos.vm_present::parse_vmconfig - failed to parse')
 return vmconfig

def _parse_vmconfig ( config , instances ) : vmconfig = None if isinstance ( config , salt . utils . odict . OrderedDict ) : vmconfig = OrderedDict ( ) for prop in config . keys ( ) : if ( prop not in instances ) : vmconfig [ prop ] = config [ prop ] else : if ( not isinstance ( config [ prop ] , salt . utils . odict . OrderedDict ) ) : continue vmconfig [ prop ] = [ ] for instance in config [ prop ] : instance_config = config [ prop ] [ instance ] instance_config [ instances [ prop ] ] = instance vmconfig [ prop ] . append ( instance_config ) else : log . error ( 'smartos.vm_present::parse_vmconfig - failed to parse' ) return vmconfig
parse vm_present vm config .