def get_vnc_config_spec(client_factory, port):
 virtual_machine_config_spec = client_factory.create('ns0:VirtualMachineConfigSpec')
 opt_enabled = client_factory.create('ns0:OptionValue')
 opt_enabled.key = 'RemoteDisplay.vnc.enabled'
 opt_enabled.value = 'true'
 opt_port = client_factory.create('ns0:OptionValue')
 opt_port.key = 'RemoteDisplay.vnc.port'
 opt_port.value = port
 opt_keymap = client_factory.create('ns0:OptionValue')
 opt_keymap.key = 'RemoteDisplay.vnc.keyMap'
 opt_keymap.value = CONF.vnc.keymap
 extras = [opt_enabled, opt_port, opt_keymap]
 virtual_machine_config_spec.extraConfig = extras
 return virtual_machine_config_spec

def get_vnc_config_spec ( client_factory , port ) : virtual_machine_config_spec = client_factory . create ( 'ns0:VirtualMachineConfigSpec' ) opt_enabled = client_factory . create ( 'ns0:OptionValue' ) opt_enabled . key = 'RemoteDisplay.vnc.enabled' opt_enabled . value = 'true' opt_port = client_factory . create ( 'ns0:OptionValue' ) opt_port . key = 'RemoteDisplay.vnc.port' opt_port . value = port opt_keymap = client_factory . create ( 'ns0:OptionValue' ) opt_keymap . key = 'RemoteDisplay.vnc.keyMap' opt_keymap . value = CONF . vnc . keymap extras = [ opt_enabled , opt_port , opt_keymap ] virtual_machine_config_spec . extraConfig = extras return virtual_machine_config_spec
builds the vnc config spec .