#NEWLINE# @ fake_tasks ( fake_rpc = False , mock_rpc = False ) #NEWLINE# @ patch ( 'nailgun.rpc.cast' ) #NEWLINE# def test_vms_reset_on_provisioning( self , mocked_rpc = None ) : #NEWLINE# #INDENT# self . env . create ( nodes_kwargs = [ { #NEWLINE# #INDENT# 'api' : False , #NEWLINE# 'roles' : [ 'virt' ] , #NEWLINE# 'status' : consts . NODE_STATUSES . ready , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'api' : False , #NEWLINE# 'roles' : [ 'virt' ] , #NEWLINE# #UNINDENT# } ] ) #NEWLINE# nodes = self . env . nodes #NEWLINE# nodes [ 0 ] . vms_conf = [ { #NEWLINE# #INDENT# 'id' : 1 , #NEWLINE# 'cpu' : 1 , #NEWLINE# 'mem' : 2 , #NEWLINE# 'created' : True , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'id' : 2 , #NEWLINE# 'cpu' : 1 , #NEWLINE# 'mem' : 2 , #NEWLINE# 'created' : True , #NEWLINE# #UNINDENT# } ] #NEWLINE# nodes [ 1 ] . vms_conf = [ { #NEWLINE# #INDENT# 'id' : 1 , #NEWLINE# 'cpu' : 2 , #NEWLINE# 'mem' : 4 , #NEWLINE# #UNINDENT# } ] #NEWLINE# self . db . commit ( ) #NEWLINE# self . env . launch_provisioning_selected ( [ str ( nodes [ 0 ] . id ) ] ) #NEWLINE# for conf in nodes [ 0 ] . vms_conf : #NEWLINE# #INDENT# self . assertFalse ( conf [ 'created' ] )