diff --git a/watcherclient/common/base.py b/watcherclient/common/base.py index 05a9093..fc33b45 100644 --- a/watcherclient/common/base.py +++ b/watcherclient/common/base.py @@ -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):