#NEWLINE# @ base . remotable_classmethod #NEWLINE# def get_by_volume_and_instance( cls , context , volume_id , instance_uuid , expected_attrs = None ) : #NEWLINE# #INDENT# if ( expected_attrs is None ) : #NEWLINE# #INDENT# expected_attrs = [ ] #NEWLINE# #UNINDENT# db_bdm = db . block_device_mapping_get_by_instance_and_volume_id ( context , volume_id , instance_uuid , _expected_cols ( db_bdm ) ) #NEWLINE# if ( not db_bdm ) : #NEWLINE# #INDENT# raise exception . VolumeBDMNotFound ( volume_id = volume_id ) #NEWLINE# #UNINDENT# return cls . _from_db_object ( context , cls ( ) , db_bdm , expected_attrs = expected_attrs )