aboutsummaryrefslogtreecommitdiffstats
path: root/keystone-moon/keystone
diff options
context:
space:
mode:
authorasteroide <thomas.duval@orange.com>2015-09-15 11:14:47 +0200
committerasteroide <thomas.duval@orange.com>2015-09-15 11:14:47 +0200
commitcfc2a16441ee3e031b453d56cce4b482b7b2f132 (patch)
tree7944406cde9fabf836f79f43a8d690ef77ffb65f /keystone-moon/keystone
parent0c488612d6e33c5c03794d9858ace0d116b78fb4 (diff)
The genre attribute may be not set. So automatically setting it, by looking to the name of the model.
Change-Id: I744ee376e6b235bfb3a7ac75582e8d9426746d35
Diffstat (limited to 'keystone-moon/keystone')
-rw-r--r--keystone-moon/keystone/contrib/moon/core.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/keystone-moon/keystone/contrib/moon/core.py b/keystone-moon/keystone/contrib/moon/core.py
index aa6db0cc..dc431a49 100644
--- a/keystone-moon/keystone/contrib/moon/core.py
+++ b/keystone-moon/keystone/contrib/moon/core.py
@@ -853,6 +853,11 @@ class IntraExtensionManager(manager.Manager):
ie_dict["name"] = filter_input(intra_extension_dict["name"])
ie_dict["model"] = filter_input(intra_extension_dict["model"])
ie_dict["genre"] = filter_input(intra_extension_dict["genre"])
+ if not ie_dict["genre"]:
+ if "admin" in ie_dict["model"] or "root" in ie_dict["model"]:
+ ie_dict["genre"] = "admin"
+ else:
+ ie_dict["genre"] = "authz"
ie_dict["description"] = filter_input(intra_extension_dict["description"])
ref = self.driver.set_intra_extension_dict(ie_dict['id'], ie_dict)
self.moonlog_api.debug("Creation of IE: {}".format(ref))