Merge "Refactor the getid method base.py"

This commit is contained in:
Zuul
2018-11-19 09:01:44 +00:00
committed by Gerrit Code Review

View File

@@ -31,10 +31,7 @@ def getid(obj):
Abstracts the common pattern of allowing both an object or an
object's ID (UUID) as a parameter when dealing with relationships.
"""
try:
return obj.id
except AttributeError:
return obj
return getattr(obj, 'id', obj)
class Manager(object):