def get_vm_extra_config_spec(client_factory, extra_opts):
 config_spec = client_factory.create('ns0:VirtualMachineConfigSpec')
 extra_config = []
 for (key, value) in extra_opts.items():
  opt = client_factory.create('ns0:OptionValue')
  opt.key = key
  opt.value = value
  extra_config.append(opt)
  config_spec.extraConfig = extra_config
 return config_spec

def get_vm_extra_config_spec ( client_factory , extra_opts ) : config_spec = client_factory . create ( 'ns0:VirtualMachineConfigSpec' ) extra_config = [ ] for ( key , value ) in extra_opts . items ( ) : opt = client_factory . create ( 'ns0:OptionValue' ) opt . key = key opt . value = value extra_config . append ( opt ) config_spec . extraConfig = extra_config return config_spec
builds extra spec fields from a dictionary .