def getid(obj):
    try:
        if obj.uuid:
            return obj.uuid
    except AttributeError:
        pass
    try:
        return obj.id
    except AttributeError:
        return obj


# TODO(aababilov): call run_hooks() in HookableMixin's child classes
Return id if argument is a Resource.
dataset/ETHPy150Open openstack/python-solumclient/solumclient/openstack/common/apiclient/base.py/getid