#NEWLINE# def dispatch_service_vm_fake( self , context , instance_name , vm_image , vm_flavor , hosting_device_drv , credentials_info , connectivity_info , ports = None ) : #NEWLINE# #INDENT# mgmt_port = connectivity_info [ 'mgmt_port' ] #NEWLINE# try : #NEWLINE# #INDENT# hosting_device_drv . create_config ( context , credentials_info , connectivity_info ) #NEWLINE# #UNINDENT# except IOError : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# vm_id = uuidutils . generate_uuid ( ) #NEWLINE# if ( mgmt_port is not None ) : #NEWLINE# #INDENT# p_dict = { #NEWLINE# #INDENT# 'port' : { #NEWLINE# #INDENT# 'device_id' : vm_id , #NEWLINE# 'device_owner' : 'nova' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# self . _core_plugin . update_port ( context , mgmt_port [ 'id' ] , p_dict ) #NEWLINE# #UNINDENT# for port in ( ports or { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# p_dict = { #NEWLINE# #INDENT# 'port' : { #NEWLINE# #INDENT# 'device_id' : vm_id , #NEWLINE# 'device_owner' : 'nova' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# self . _core_plugin . update_port ( context , p_dict [ 'id' ] , p_dict ) #NEWLINE# #UNINDENT# myserver = { #NEWLINE# #INDENT# 'server' : { #NEWLINE# #INDENT# 'adminPass' : 'MVk5HPrazHcG' , #NEWLINE# 'id' : vm_id , #NEWLINE# 'links' : [ { #NEWLINE# #INDENT# 'href' : ( 'http://openstack.example.com/v2/openstack/servers/' + vm_id ) , #NEWLINE# 'rel' : 'self' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'href' : ( 'http://openstack.example.com/openstack/servers/' + vm_id ) , #NEWLINE# 'rel' : 'bookmark' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# return myserver [ 'server' ]