#NEWLINE# def create( vm_ = None , call = None ) : #NEWLINE# #INDENT# '\n    Create a single GCE instance from a data dict.\n    ' #NEWLINE# if call : #NEWLINE# #INDENT# raise SaltCloudSystemExit ( 'You cannot create an instance with -a or -f.' ) #NEWLINE# #UNINDENT# node_info = request_instance ( vm_ ) #NEWLINE# if isinstance ( node_info , bool ) : #NEWLINE# #INDENT# raise SaltCloudSystemExit ( 'There was an error creating the GCE instance.' ) #NEWLINE# #UNINDENT# node_dict = node_info [ 0 ] #NEWLINE# node_data = node_info [ 1 ] #NEWLINE# ( ssh_user , ssh_key ) = __get_ssh_credentials ( vm_ ) #NEWLINE# vm_ [ 'ssh_host' ] = __get_host ( node_data , vm_ ) #NEWLINE# vm_ [ 'key_filename' ] = ssh_key #NEWLINE# salt . utils . cloud . bootstrap ( vm_ , __opts__ ) #NEWLINE# log . info ( "Created Cloud VM '{0[name]}'" . format ( vm_ ) ) #NEWLINE# log . trace ( "'{0[name]}' VM creation details:\n{1}" . format ( vm_ , pprint . pformat ( node_dict ) ) ) #NEWLINE# salt . utils . cloud . fire_event ( 'event' , 'created instance' , 'salt/cloud/{0}/created' . format ( vm_ [ 'name' ] ) , { #NEWLINE# #INDENT# 'name' : vm_ [ 'name' ] , #NEWLINE# 'profile' : vm_ [ 'profile' ] , #NEWLINE# 'provider' : vm_ [ 'driver' ] , #NEWLINE# #UNINDENT# } , transport = __opts__ [ 'transport' ] ) #NEWLINE# return node_dict