[Kimchi-devel] [PATCH] [Kimchi 1/4] Update Kimchi configuration according to recent changes on Wok

Aline Manera alinefm at linux.vnet.ibm.com
Fri Jan 22 12:38:44 UTC 2016


The application name and sub_nodes are restricted for the application
configuration and should never be edited. In that case, it is good to
remove this kind of information from a configuration file.

According to the recent changes on Wok, the application name will be the plugin
name with the first letter in uppercase. And the sub_nodes automatically
imported from control module.

Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
---
 __init__.py             | 6 +++---
 kimchi.conf             | 5 +++--
 root.py                 | 6 +++---
 tests/test_config.py.in | 6 ++----
 4 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/__init__.py b/__init__.py
index d253d84..592793d 100644
--- a/__init__.py
+++ b/__init__.py
@@ -1,7 +1,7 @@
 #
 # Project Kimchi
 #
-# Copyright IBM, Corp. 2013-2014
+# Copyright IBM, Corp. 2013-2016
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -17,5 +17,5 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 
-from wok.plugins.kimchi.root import KimchiRoot
-__all__ = [KimchiRoot]
+from wok.plugins.kimchi.root import Kimchi
+__all__ = [Kimchi]
diff --git a/kimchi.conf b/kimchi.conf
index 1b0dbb3..8df72f3 100644
--- a/kimchi.conf
+++ b/kimchi.conf
@@ -1,8 +1,9 @@
 [wok]
+# Enable Kimchi plugin on Wok server (values: True|False)
 enable = True
-plugin_class = "KimchiRoot"
+
+# Root URI for Kimchi APIs
 uri = "/plugins/kimchi"
-extra_auth_api_class = "control.sub_nodes"
 
 [/]
 tools.trailing_slash.on = False
diff --git a/root.py b/root.py
index cee30f6..4b56772 100644
--- a/root.py
+++ b/root.py
@@ -1,7 +1,7 @@
 #
 # Project Kimchi
 #
-# Copyright IBM, Corp. 2013-2015
+# Copyright IBM, Corp. 2013-2016
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -31,7 +31,7 @@ from wok.root import WokRoot
 from wok.utils import upgrade_objectstore_schema
 
 
-class KimchiRoot(WokRoot):
+class Kimchi(WokRoot):
     def __init__(self, wok_options):
         make_dirs = [
             os.path.dirname(os.path.abspath(config.get_object_store())),
@@ -50,7 +50,7 @@ class KimchiRoot(WokRoot):
             self.model = kimchiModel.Model()
 
         dev_env = wok_options.environment != 'production'
-        super(KimchiRoot, self).__init__(self.model, dev_env)
+        super(Kimchi, self).__init__(self.model, dev_env)
 
         for ident, node in sub_nodes.items():
             setattr(self, ident, node(self.model))
diff --git a/tests/test_config.py.in b/tests/test_config.py.in
index 249176d..abb1d75 100644
--- a/tests/test_config.py.in
+++ b/tests/test_config.py.in
@@ -1,7 +1,7 @@
 #
 # Project Kimchi
 #
-# Copyright IBM, Corp. 2014-2015
+# Copyright IBM, Corp. 2014-2016
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -76,10 +76,8 @@ class ConfigTests(unittest.TestCase):
         pluginPrefix = paths.add_prefix(paths.plugin_dir)
         configObj = {
             'wok': {
-                'plugin_class': 'KimchiRoot',
                 'enable': True,
-                'uri': '/plugins/kimchi',
-                'extra_auth_api_class': 'control.sub_nodes'
+                'uri': '/plugins/kimchi'
             },
             '/': {
                 'tools.trailing_slash.on': False,
-- 
2.5.0




More information about the Kimchi-devel mailing list