[Kimchi-devel] [PATCH] [Kimchi] Bug fix: Let Wok specify UI configuration on cherrypy settings

Aline Manera posted 1 patch 7 years ago
Failed in applying to current master (apply log)
config.py.in            | 14 +-------------
tests/test_config.py.in |  1 +
2 files changed, 2 insertions(+), 13 deletions(-)
[Kimchi-devel] [PATCH] [Kimchi] Bug fix: Let Wok specify UI configuration on cherrypy settings
Posted by Aline Manera 7 years ago
Signed-off-by: Aline Manera <alinefm@linux.vnet.ibm.com>
---
 config.py.in            | 14 +-------------
 tests/test_config.py.in |  1 +
 2 files changed, 2 insertions(+), 13 deletions(-)
---

Depends on Wok patch:
- [PATCH] [Wok] Bug fix #1109: Specify Content-Type	for SVG files

---

diff --git a/config.py.in b/config.py.in
index a887670..de7024e 100644
--- a/config.py.in
+++ b/config.py.in
@@ -24,7 +24,7 @@ import platform
 import threading
 from cherrypy.lib.reprconf import Parser
 
-from wok.config import CACHEEXPIRES, PluginConfig, PluginPaths
+from wok.config import PluginConfig, PluginPaths
 from wok.xmlutils.utils import xpath_get_text
 
 kimchiLock = threading.Lock()
@@ -172,16 +172,4 @@ class KimchiConfig(PluginConfig):
                 custom_config[uri].update({'tools.staticfile.on': True,
                                            'tools.staticfile.filename': path})
 
-        for dirname in ('css', 'js', 'images'):
-            custom_config['/' + dirname] = {
-                'tools.staticdir.on': True,
-                'tools.staticdir.dir': os.path.join(kimchiPaths.ui_dir,
-                                                    dirname),
-                'tools.wokauth.on': False,
-                'tools.nocache.on': False}
-            if dirname != 'images':
-                custom_config['/' + dirname].update({
-                    'tools.expires.on': True,
-                    'tools.expires.secs': CACHEEXPIRES})
-
         self.update(custom_config)
diff --git a/tests/test_config.py.in b/tests/test_config.py.in
index 74ea84a..d8110ea 100644
--- a/tests/test_config.py.in
+++ b/tests/test_config.py.in
@@ -144,6 +144,7 @@ class ConfigTests(unittest.TestCase):
                 'tools.wokauth.on': False,
                 'tools.nocache.on': False,
                 'tools.staticdir.dir': '%s/ui/images' % pluginPrefix,
+                'tools.staticdir.content_types': {'svg': 'image/svg+xml'},
                 'tools.staticdir.on': True
             },
             '/data/screenshots': {
-- 
2.9.3

_______________________________________________
Kimchi-devel mailing list
Kimchi-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/kimchi-devel
Re: [Kimchi-devel] [PATCH] [Kimchi] Bug fix: Let Wok specify UI configuration on cherrypy settings
Posted by Aline Manera 7 years ago
Applied. Thanks.

Regards,

Aline Manera

_______________________________________________
Kimchi-devel mailing list
Kimchi-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/kimchi-devel
Re: [Kimchi-devel] [PATCH] [Kimchi] Bug fix: Let Wok specify UI configuration on cherrypy settings
Posted by Daniel Henrique Barboza 7 years ago
Reviewed-by: Daniel Barboza <danielhb@linux.vnet.ibm.com>

On 04/03/2017 07:59 PM, Aline Manera wrote:
> Signed-off-by: Aline Manera <alinefm@linux.vnet.ibm.com>
> ---
>   config.py.in            | 14 +-------------
>   tests/test_config.py.in |  1 +
>   2 files changed, 2 insertions(+), 13 deletions(-)
> ---
>
> Depends on Wok patch:
> - [PATCH] [Wok] Bug fix #1109: Specify Content-Type	for SVG files
>
> ---
>
> diff --git a/config.py.in b/config.py.in
> index a887670..de7024e 100644
> --- a/config.py.in
> +++ b/config.py.in
> @@ -24,7 +24,7 @@ import platform
>   import threading
>   from cherrypy.lib.reprconf import Parser
>   
> -from wok.config import CACHEEXPIRES, PluginConfig, PluginPaths
> +from wok.config import PluginConfig, PluginPaths
>   from wok.xmlutils.utils import xpath_get_text
>   
>   kimchiLock = threading.Lock()
> @@ -172,16 +172,4 @@ class KimchiConfig(PluginConfig):
>                   custom_config[uri].update({'tools.staticfile.on': True,
>                                              'tools.staticfile.filename': path})
>   
> -        for dirname in ('css', 'js', 'images'):
> -            custom_config['/' + dirname] = {
> -                'tools.staticdir.on': True,
> -                'tools.staticdir.dir': os.path.join(kimchiPaths.ui_dir,
> -                                                    dirname),
> -                'tools.wokauth.on': False,
> -                'tools.nocache.on': False}
> -            if dirname != 'images':
> -                custom_config['/' + dirname].update({
> -                    'tools.expires.on': True,
> -                    'tools.expires.secs': CACHEEXPIRES})
> -
>           self.update(custom_config)
> diff --git a/tests/test_config.py.in b/tests/test_config.py.in
> index 74ea84a..d8110ea 100644
> --- a/tests/test_config.py.in
> +++ b/tests/test_config.py.in
> @@ -144,6 +144,7 @@ class ConfigTests(unittest.TestCase):
>                   'tools.wokauth.on': False,
>                   'tools.nocache.on': False,
>                   'tools.staticdir.dir': '%s/ui/images' % pluginPrefix,
> +                'tools.staticdir.content_types': {'svg': 'image/svg+xml'},
>                   'tools.staticdir.on': True
>               },
>               '/data/screenshots': {

_______________________________________________
Kimchi-devel mailing list
Kimchi-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/kimchi-devel