#NEWLINE# def test_bdm_update_or_create_with_false_create_vol_id( self ) : #NEWLINE# #INDENT# fake_bdm = { #NEWLINE# #INDENT# 'id' : 'fake_id' , #NEWLINE# 'instance_uuid' : 'fake_instance_uuid' , #NEWLINE# 'device_name' : 'fake_device_name' , #NEWLINE# 'volume_id' : 'fake_volume_id' , #NEWLINE# #UNINDENT# } #NEWLINE# expected_bdm = fake_bdm . copy ( ) #NEWLINE# expected_bdm . pop ( 'id' ) #NEWLINE# fake_inst_bdms = [ { #NEWLINE# #INDENT# 'id' : 1 , #NEWLINE# 'volume_id' : 'not-a-match' , #NEWLINE# 'device_name' : 'not-a-match' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'id' : 2 , #NEWLINE# 'volume_id' : 'fake_volume_id' , #NEWLINE# 'device_name' : 'not-a-match' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'id' : 3 , #NEWLINE# 'volume_id' : 'not-a-match' , #NEWLINE# 'device_name' : 'not-a-match' , #NEWLINE# #UNINDENT# } ] #NEWLINE# self . mox . StubOutWithMock ( self . src_db_inst , 'block_device_mapping_update' ) #NEWLINE# self . mox . StubOutWithMock ( self . mid_db_inst , 'block_device_mapping_update' ) #NEWLINE# self . mox . StubOutWithMock ( self . tgt_db_inst , 'block_device_mapping_get_all_by_instance' ) #NEWLINE# self . mox . StubOutWithMock ( self . tgt_db_inst , 'block_device_mapping_update' ) #NEWLINE# self . tgt_db_inst . block_device_mapping_get_all_by_instance ( self . ctxt , 'fake_instance_uuid' ) . AndReturn ( fake_inst_bdms ) #NEWLINE# self . tgt_db_inst . block_device_mapping_update ( self . ctxt , 2 , expected_bdm , legacy = False ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# self . src_msg_runner . bdm_update_or_create_at_top ( self . ctxt , fake_bdm , create = False )