aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorasteroide <thomas.duval@orange.com>2015-11-20 15:38:46 +0100
committerasteroide <thomas.duval@orange.com>2015-11-20 15:38:46 +0100
commit2918dd466ef6a8e526698ca3f1bc7f9b793f2824 (patch)
tree97a0a2df0c445c2e90b85ee1a1100b07cf18869a
parentb4e1e3ac15988512e96200c4528f5423586a4132 (diff)
Add an init API function to force the reload of the root intra-extension.
Change-Id: Ieee84a30cbd1ee0a5d4ca3359b7f5afbc39afffc
-rw-r--r--keystone-moon/keystone/contrib/moon/controllers.py4
-rw-r--r--keystone-moon/keystone/contrib/moon/routers.py6
-rw-r--r--moonclient/moonclient/intraextension.py15
-rw-r--r--moonclient/setup.py1
4 files changed, 26 insertions, 0 deletions
diff --git a/keystone-moon/keystone/contrib/moon/controllers.py b/keystone-moon/keystone/contrib/moon/controllers.py
index 58e62a28..84e27fa3 100644
--- a/keystone-moon/keystone/contrib/moon/controllers.py
+++ b/keystone-moon/keystone/contrib/moon/controllers.py
@@ -208,6 +208,10 @@ class IntraExtensions(controller.V3Controller):
intra_extension_dict['description'] = kw.get('intra_extension_description', None)
return self.admin_api.set_intra_extension_dict(user_id, intra_extension_id, intra_extension_dict)
+ @controller.protected()
+ def load_root_intra_extension(self, context, **kw):
+ self.admin_api.load_root_intra_extension_dict()
+
# Metadata functions
@controller.protected()
def get_subject_categories(self, context, **kw):
diff --git a/keystone-moon/keystone/contrib/moon/routers.py b/keystone-moon/keystone/contrib/moon/routers.py
index 357ae060..fd1c0adf 100644
--- a/keystone-moon/keystone/contrib/moon/routers.py
+++ b/keystone-moon/keystone/contrib/moon/routers.py
@@ -89,6 +89,12 @@ class Routers(wsgi.V3ExtensionRouter):
# IntraExtensions/Admin route
self._add_resource(
mapper, intra_ext_controller,
+ path=self.PATH_PREFIX+'/intra_extensions/init',
+ get_action='load_root_intra_extension',
+ rel=self._get_rel('intra_extensions'),
+ path_vars={})
+ self._add_resource(
+ mapper, intra_ext_controller,
path=self.PATH_PREFIX+'/intra_extensions',
get_action='get_intra_extensions',
post_action='add_intra_extension',
diff --git a/moonclient/moonclient/intraextension.py b/moonclient/moonclient/intraextension.py
index 569a99ff..24286dd9 100644
--- a/moonclient/moonclient/intraextension.py
+++ b/moonclient/moonclient/intraextension.py
@@ -110,6 +110,21 @@ class IntraExtensionDelete(Command):
authtoken=True)
+class IntraExtensionInit(Command):
+ """Initialize the root Intra_Extension (if needed)."""
+
+ log = logging.getLogger(__name__)
+
+ def get_parser(self, prog_name):
+ parser = super(IntraExtensionInit, self).get_parser(prog_name)
+ return parser
+
+ def take_action(self, parsed_args):
+ self.app.get_url("/v3/OS-MOON/intra_extensions/init",
+ method="GET",
+ authtoken=True)
+
+
class IntraExtensionShow(ShowOne):
"""Show detail about one Intra_Extension."""
diff --git a/moonclient/setup.py b/moonclient/setup.py
index e048bf97..71ea704b 100644
--- a/moonclient/setup.py
+++ b/moonclient/setup.py
@@ -73,6 +73,7 @@ setup(
'intraextension_list = moonclient.intraextension:IntraExtensionList',
'intraextension_delete = moonclient.intraextension:IntraExtensionDelete',
'intraextension_show = moonclient.intraextension:IntraExtensionShow',
+ 'intraextension_init = moonclient.intraextension:IntraExtensionInit',
'subject_list = moonclient.subjects:SubjectsList',
'subject_add = moonclient.subjects:SubjectsAdd',