[Kimchi-devel] [PATCH] [Kimchi] Remove help and screenshot URI configuraton from kimchi.conf file

Aline Manera alinefm at linux.vnet.ibm.com
Fri Feb 19 20:35:34 UTC 2016


kimchi.conf file may be edited by user and the information related to
the help pages and screenshot files location can not be changed as it is
defined in the application setup.
So move the help and screenshot URI configuration to config.py.in

Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
---
 config.py.in | 11 ++++++++++-
 kimchi.conf  | 10 ----------
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/config.py.in b/config.py.in
index 0753a00..3cd2e80 100644
--- a/config.py.in
+++ b/config.py.in
@@ -128,6 +128,7 @@ class KimchiConfig(PluginConfig):
         super(KimchiConfig, self).__init__('kimchi')
 
         static_config = {
+
             '/novnc': {'type': 'dir',
                        'path': kimchiPaths.novnc_dir},
             '/spice-html5': {'type': 'dir',
@@ -139,7 +140,15 @@ class KimchiConfig(PluginConfig):
             '/serial': {'type': 'dir',
                         'path': kimchiPaths.serial_dir}}
 
-        custom_config = {}
+        custom_config = {
+            '/help': {'tools.nocache.on': True,
+                      'tools.staticdir.dir':
+                      os.path.join(kimchiPaths.ui_dir, 'pages/help'),
+                      'tools.staticdir.on': True},
+            '/data/screenshots': {'tools.nocache.on': False,
+                                  'tools.staticdir.dir':
+                                  get_screenshot_path(),
+                                  'tools.staticdir.on': True}}
         for uri, data in static_config.iteritems():
             custom_config[uri] = {'tools.nocache.on': True,
                                   'tools.wokauth.on': True}
diff --git a/kimchi.conf b/kimchi.conf
index 108ef9c..1bfd6f9 100644
--- a/kimchi.conf
+++ b/kimchi.conf
@@ -25,13 +25,3 @@ tools.sessions.httponly = True
 tools.sessions.locking = 'explicit'
 tools.sessions.storage_type = 'ram'
 tools.sessions.timeout = 10
-
-[/data/screenshots]
-tools.staticdir.on = True
-tools.staticdir.dir = wok.config.PluginPaths('kimchi').state_dir + '/screenshots'
-tools.nocache.on = False
-
-[/help]
-tools.staticdir.on = True
-tools.staticdir.dir = wok.config.PluginPaths('kimchi').ui_dir + '/pages/help'
-tools.nocache.on = True
-- 
2.5.0




More information about the Kimchi-devel mailing list