Make the match more specific (#37538)

This commit is contained in:
Vasili Syrakis 2016-11-10 07:42:11 +11:00 committed by Nicole Thomas
parent b3f436e14d
commit c6cd39a1c0

View File

@ -715,7 +715,8 @@ def get_mor_by_property(service_instance, object_type, property_value, property_
object_list = get_mors_with_properties(service_instance, object_type, property_list=[property_name], container_ref=container_ref)
for obj in object_list:
if obj[property_name] == property_value or property_value in str(obj.get('object', '')):
obj_id = str(obj.get('object', '')).strip('\'"')
if obj[property_name] == property_value or property_value == obj_id:
return obj['object']
return None