diff options
Diffstat (limited to 'moonv4')
-rw-r--r-- | moonv4/moon_db/moon_db/__init__.py | 2 | ||||
-rw-r--r-- | moonv4/moon_db/moon_db/api/policy.py | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/moonv4/moon_db/moon_db/__init__.py b/moonv4/moon_db/moon_db/__init__.py index 5eb389d3..515227fa 100644 --- a/moonv4/moon_db/moon_db/__init__.py +++ b/moonv4/moon_db/moon_db/__init__.py @@ -3,5 +3,5 @@ # license which can be found in the file 'LICENSE' in this package distribution # or at 'http://www.apache.org/licenses/LICENSE-2.0'. -__version__ = "1.2.0" +__version__ = "1.2.1" diff --git a/moonv4/moon_db/moon_db/api/policy.py b/moonv4/moon_db/moon_db/api/policy.py index 093d14bd..272872ad 100644 --- a/moonv4/moon_db/moon_db/api/policy.py +++ b/moonv4/moon_db/moon_db/api/policy.py @@ -56,11 +56,16 @@ class PolicyManager(Managers): k_user = Managers.KeystoneManager.create_user(value) if not perimeter_id: try: + LOG.info("k_user={}".format(k_user)) perimeter_id = k_user['users'][0].get('id', uuid4().hex) except IndexError: k_user = Managers.KeystoneManager.get_user_by_name( value.get('name')) perimeter_id = uuid4().hex + except KeyError: + k_user = Managers.KeystoneManager.get_user_by_name( + value.get('name')) + perimeter_id = uuid4().hex value.update(k_user['users'][0]) return self.driver.set_subject(policy_id=policy_id, perimeter_id=perimeter_id, value=value) |