Add_tenant can now be used even if the tenant ID is unknown. 19/1419/1
authorasteroide <thomas.duval@orange.com>
Tue, 8 Sep 2015 12:43:58 +0000 (14:43 +0200)
committerasteroide <thomas.duval@orange.com>
Tue, 8 Sep 2015 12:43:58 +0000 (14:43 +0200)
Change-Id: I623483c99a349bd1ccc3b5b88c3973ce28dfd633

keystone-moon/keystone/contrib/moon/core.py

index cf15b6f..8916e2b 100644 (file)
@@ -198,7 +198,9 @@ def enforce(action_names, object_name, **extra):
                         # id is in fact a tenant id so, we must check against the Root intra_extension
                         intra_extension_id = intra_root_extension_id
                     else:
-                        raise IntraExtensionUnknown()
+                        # id is not a known tenant ID, so we must check against the Root intra_extension
+                        intra_extension_id = intra_root_extension_id
+                        LOG.warning("Cannot enforce because the intra-extension is unknown ({})".format(intra_extension_id))
                 try:
                     tenants_dict = self.tenant_api.driver.get_tenants_dict()
                 except AttributeError: