<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def l3_tenant_id(cls):
 """Returns id of tenant owning hosting device resources."""

        if cls._l3_tenant_uuid is None:
            if hasattr(cfg.CONF.keystone_authtoken, 'project_domain_id'):
                # TODO(sridar): hack for now to determing if keystone v3
                # API is to be used.
                cls._l3_tenant_uuid = cls._get_tenant_id_using_keystone_v3()
            else:
                cls._l3_tenant_uuid = cls._get_tenant_id_using_keystone_v2()
        return cls._l3_tenant_uuid