[PATCH] Fxi for Clone and Delete VM messages obstructed
by Socorro Stoppler
From: Socorro Stoppler <socorrob(a)us.ibm.com>
Messages shown in confirmation box for clone and delete VM are
obstructed so the size of the box was adjusted to handle accordingly.
Socorro Stoppler (1):
Fix confirmation box for delete and clone
ui/css/theme-default/message.css | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--
1.9.1
9 years, 3 months
[wok] Fix bug #724: Fix test_kimchi_config
by Lucio Correia
This patch fixes Kimchi config test and adds Wok config
test.
IMPORTANT: this patch is based on Wok V3, but will conflict with Samuel's
[PATCH 1/5] [WOK] Removing fontello references and unused CSS and old JS. The
fontello occurrences in test_config.py.in should be replaced with fontawesome.
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
---
plugins/kimchi/config.py.in | 6 +-
plugins/kimchi/kimchi.conf | 8 --
plugins/kimchi/tests/test_config.py.in | 146 ++++++++++++++++++++++------
plugins/kimchi/ui/images/Makefile.am | 2 +-
plugins/kimchi/ui/images/logo.ico | Bin 1214 -> 0 bytes
plugins/kimchi/ui/pages/help/dita-help.xsl | 2 +-
src/wok/config.py.in | 8 ++
7 files changed, 131 insertions(+), 41 deletions(-)
delete mode 100644 plugins/kimchi/ui/images/logo.ico
diff --git a/plugins/kimchi/config.py.in b/plugins/kimchi/config.py.in
index 80b72bd..2974e7e 100644
--- a/plugins/kimchi/config.py.in
+++ b/plugins/kimchi/config.py.in
@@ -23,7 +23,7 @@ import os
import platform
import threading
-from wok.config import PluginPaths
+from wok.config import PluginConfig, PluginPaths
from wok.xmlutils.utils import xpath_get_text
kimchiLock = threading.Lock()
@@ -103,9 +103,9 @@ class KimchiPaths(PluginPaths):
kimchiPaths = KimchiPaths()
-class KimchiConfig(dict):
+class KimchiConfig(PluginConfig):
def __init__(self):
- super(KimchiConfig, self).__init__(self)
+ super(KimchiConfig, self).__init__('kimchi')
custom_config = {
'/novnc': {
diff --git a/plugins/kimchi/kimchi.conf b/plugins/kimchi/kimchi.conf
index 78f4f3f..1bf78e4 100644
--- a/plugins/kimchi/kimchi.conf
+++ b/plugins/kimchi/kimchi.conf
@@ -30,14 +30,6 @@ tools.nocache.on = False
tools.wokauth.on = True
tools.staticdir.content_types = {'xz': 'application/x-xz'}
-[/favicon.ico]
-tools.staticfile.on = True
-tools.staticfile.filename = wok.config.PluginPaths('kimchi').ui_dir + '/images/logo.ico'
-
-[/robots.txt]
-tools.staticfile.on = True
-tools.staticfile.filename = wok.config.PluginPaths('kimchi').ui_dir + '/robots.txt'
-
[/help]
tools.staticdir.on = True
tools.staticdir.dir = wok.config.PluginPaths('kimchi').ui_dir + '/pages/help'
diff --git a/plugins/kimchi/tests/test_config.py.in b/plugins/kimchi/tests/test_config.py.in
index 6bca3df..7bd28bc 100644
--- a/plugins/kimchi/tests/test_config.py.in
+++ b/plugins/kimchi/tests/test_config.py.in
@@ -20,11 +20,11 @@
import unittest
from cherrypy.lib.reprconf import Parser
-from wok.config import Paths
+from wok.config import Paths, PluginPaths, WokConfig
from wok.plugins.kimchi.config import get_debugreports_path
from wok.plugins.kimchi.config import get_screenshot_path
-from wok.plugins.kimchi.config import KimchiPaths
+from wok.plugins.kimchi.config import KimchiConfig, KimchiPaths
from wok.plugins.kimchi import config as kconfig
@@ -92,8 +92,9 @@ class ConfigTests(unittest.TestCase):
self.assertEquals(paths.ui_dir, '/home/user/wok/plugins/kimchi/ui')
self.assertEquals(paths.mo_dir, '/home/user/wok/plugins/kimchi/mo')
- def test_kimchi_config(self):
- Paths.get_prefix = KimchiPaths.get_prefix = get_prefix
+ def test_wok_config(self):
+ Paths.get_prefix = PluginPaths.get_prefix = get_prefix
+ paths = Paths()
CACHEEXPIRES = 31536000
SESSIONSTIMEOUT = 10
configObj = {
@@ -111,56 +112,154 @@ class ConfigTests(unittest.TestCase):
'tools.sessions.timeout': SESSIONSTIMEOUT,
'tools.wokauth.on': False
},
+ '/wok-ui.html': {
+ 'tools.wokauth.on': True
+ },
+ '/css': {
+ 'tools.staticdir.on': True,
+ 'tools.staticdir.dir': '%s/ui/css' % paths.prefix,
+ 'tools.expires.on': True,
+ 'tools.expires.secs': CACHEEXPIRES,
+ 'tools.nocache.on': False,
+ 'tools.wokauth.on': False
+ },
+ '/fontello': {
+ 'tools.staticdir.on': True,
+ 'tools.staticdir.dir': '%s/ui/fontello' % paths.prefix,
+ 'tools.expires.on': True,
+ 'tools.expires.secs': CACHEEXPIRES,
+ 'tools.nocache.on': False,
+ 'tools.wokauth.on': False
+ },
+ '/js': {
+ 'tools.staticdir.on': True,
+ 'tools.staticdir.dir': '%s/ui/js' % paths.prefix,
+ 'tools.expires.on': True,
+ 'tools.expires.secs': CACHEEXPIRES,
+ 'tools.nocache.on': False,
+ 'tools.wokauth.on': False
+ },
+ '/libs': {
+ 'tools.staticdir.on': True,
+ 'tools.staticdir.dir': '%s/ui/libs' % paths.prefix,
+ 'tools.expires.on': True,
+ 'tools.expires.secs': CACHEEXPIRES,
+ 'tools.nocache.on': False,
+ 'tools.wokauth.on': False
+ },
+ '/images': {
+ 'tools.staticdir.on': True,
+ 'tools.staticdir.dir': '%s/ui/images' % paths.prefix,
+ 'tools.nocache.on': False,
+ 'tools.wokauth.on': False
+ },
+ '/favicon.ico': {
+ 'tools.staticfile.on': True,
+ 'tools.staticfile.filename':
+ '%s/images/logo.ico' % paths.ui_dir
+ },
+ '/robots.txt': {
+ 'tools.staticfile.on': True,
+ 'tools.staticfile.filename': '%s/robots.txt' % paths.ui_dir
+ },
+ }
+
+ wok_config = WokConfig()
+ self.assertEquals(wok_config, configObj)
+
+
+ def test_kimchi_config(self):
+ KimchiPaths.get_prefix = PluginPaths.get_prefix = get_prefix
+ paths = KimchiPaths()
+ pluginPrefix = paths.add_prefix(paths.plugin_dir)
+ CACHEEXPIRES = 31536000
+ SESSIONSTIMEOUT = 10
+ configObj = {
+ 'wok': {
+ 'enable': True,
+ 'plugin_class': "KimchiRoot",
+ 'uri': '/%s' % paths.plugin_dir,
+ 'extra_auth_api_class': "control.sub_nodes"
+ },
+ '/': {
+ 'tools.trailing_slash.on': False,
+ 'request.methods_with_bodies': ('POST', 'PUT'),
+ 'tools.nocache.on': True,
+ 'tools.proxy.on': True,
+ 'tools.sessions.on': True,
+ 'tools.sessions.name': 'wok',
+ 'tools.sessions.secure': True,
+ 'tools.sessions.httponly': True,
+ 'tools.sessions.locking': 'explicit',
+ 'tools.sessions.storage_type': 'ram',
+ 'tools.sessions.timeout': SESSIONSTIMEOUT,
+ 'tools.wokauth.on': True
+ },
'/novnc': {
'tools.staticdir.on': True,
- 'tools.staticdir.dir': KimchiPaths().novnc_dir,
+ 'tools.staticdir.dir': paths.novnc_dir,
'tools.nocache.on': True,
'tools.wokauth.on': True
},
'/spice_auto.html': {
'tools.staticfile.on': True,
- 'tools.staticfile.filename': KimchiPaths().spice_file,
+ 'tools.staticfile.filename': paths.spice_file,
'tools.nocache.on': True,
'tools.wokauth.on': True
},
'/spice-html5': {
'tools.staticdir.on': True,
- 'tools.staticdir.dir': KimchiPaths().spice_dir,
+ 'tools.staticdir.dir': paths.spice_dir,
'tools.nocache.on': True
},
'/spice-html5/spice.css': {
'tools.staticfile.on': True,
- 'tools.staticfile.filename': KimchiPaths().spice_css_file,
+ 'tools.staticfile.filename': paths.spice_css_file,
'tools.nocache.on': True,
},
- '/kimchi-ui.html': {
- 'tools.wokauth.on': True
+ '/ui/config/tab-ext.xml': {
+ 'tools.staticfile.on': True,
+ 'tools.staticfile.filename': '%s/ui/config/tab-ext.xml' %
+ pluginPrefix,
+ 'tools.nocache.on': True
},
'/css': {
'tools.staticdir.on': True,
- 'tools.staticdir.dir': '%s/ui/css' % KimchiPaths().prefix,
+ 'tools.staticdir.dir': '%s/ui/css' % pluginPrefix,
'tools.expires.on': True,
'tools.expires.secs': CACHEEXPIRES,
- 'tools.nocache.on': False
+ 'tools.nocache.on': False,
+ 'tools.wokauth.on': False
+ },
+ '/fontello': {
+ 'tools.staticdir.on': True,
+ 'tools.staticdir.dir': '%s/ui/fontello' % pluginPrefix,
+ 'tools.expires.on': True,
+ 'tools.expires.secs': CACHEEXPIRES,
+ 'tools.nocache.on': False,
+ 'tools.wokauth.on': False
},
'/js': {
'tools.staticdir.on': True,
- 'tools.staticdir.dir': '%s/ui/js' % KimchiPaths().prefix,
+ 'tools.staticdir.dir': '%s/ui/js' % pluginPrefix,
'tools.expires.on': True,
'tools.expires.secs': CACHEEXPIRES,
- 'tools.nocache.on': False
+ 'tools.nocache.on': False,
+ 'tools.wokauth.on': False
},
'/libs': {
'tools.staticdir.on': True,
- 'tools.staticdir.dir': '%s/ui/libs' % KimchiPaths().prefix,
+ 'tools.staticdir.dir': '%s/ui/libs' % pluginPrefix,
'tools.expires.on': True,
'tools.expires.secs': CACHEEXPIRES,
'tools.nocache.on': False,
+ 'tools.wokauth.on': False,
},
'/images': {
'tools.staticdir.on': True,
- 'tools.staticdir.dir': '%s/ui/images' % KimchiPaths().prefix,
- 'tools.nocache.on': False
+ 'tools.staticdir.dir': '%s/ui/images' % pluginPrefix,
+ 'tools.nocache.on': False,
+ 'tools.wokauth.on': False
},
'/data/screenshots': {
'tools.staticdir.on': True,
@@ -174,22 +273,13 @@ class ConfigTests(unittest.TestCase):
'tools.wokauth.on': True,
'tools.staticdir.content_types': {'xz': 'application/x-xz'}
},
- '/favicon.ico': {
- 'tools.staticfile.on': True,
- 'tools.staticfile.filename':
- '%s/images/logo.ico' % KimchiPaths().ui_dir
- },
- '/robots.txt': {
- 'tools.staticfile.on': True,
- 'tools.staticfile.filename': '%s/robots.txt' % KimchiPaths().ui_dir
- },
'/help': {
'tools.staticdir.on': True,
- 'tools.staticdir.dir': '%s/ui/pages/help' % KimchiPaths().prefix,
- 'tools.staticdir.index': 'en_US/index.html',
+ 'tools.staticdir.dir': '%s/ui/pages/help' % pluginPrefix,
'tools.nocache.on': True
}
}
kimchi_config = Parser().dict_from_file(KimchiPaths().conf_file)
+ kimchi_config.update(KimchiConfig())
self.assertEquals(kimchi_config, configObj)
diff --git a/plugins/kimchi/ui/images/Makefile.am b/plugins/kimchi/ui/images/Makefile.am
index 0562e6a..ca3ee6e 100644
--- a/plugins/kimchi/ui/images/Makefile.am
+++ b/plugins/kimchi/ui/images/Makefile.am
@@ -19,4 +19,4 @@ SUBDIRS = theme-default
imagedir = $(datadir)/wok/plugins/kimchi/ui/images
-dist_image_DATA = *.png *.ico
+dist_image_DATA = *.png
diff --git a/plugins/kimchi/ui/images/logo.ico b/plugins/kimchi/ui/images/logo.ico
deleted file mode 100644
index 446143f066a60f479b2cb8f8d04ab3c97ff60e56..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 1214
zcma)*3rLeu6vyu=X_;nPV)$&PPF)r(wTQ|dTGOUtnOdf0mZ=cR#99xbub1{BqnD9^
z^Z>PV6h)fUny6#CN{3di2P{*h2ek@Oq0a4o*=I}2Iv?krbAR`oKi_vQA0faVCr83o
zF{!X2#Dx$Nz}$(sm^sgR<Jj30yCMGpMl1z837jm3H1$<DU4IV>Tbdw<FM-;Hi<#et
z=I}n~iB^qh8{XzCNyvT<I;$&znmT~?eFXZgAE@Om?1h(6Iq+2e1-ca!zOAO7n3*};
zXq6n?2kF<!f%cez;-Fgx4$e+xo{WR;oqhc_OW;#nF!Zm|JK}m8gi6aC+##`QA5PmJ
zfeZ(o(}%&&1P5#*1vVbnssk~XhN5bNz=T)>5^+BS=V54SJ|^z)5I7%kU;>-skiq*{
z5B^=eF<T)pK9+)bV;9UCK>t-HOi+bkR-wK1xpfXL;S<?ho1pQ5gYzxiHR~=e+XHS(
zYe7QMZb3IjWV72H-JpD~6z(tbgwn1o$D2s!YteWNJS!i9l%iW?+34Lvr*KL(6{_X|
zobEjAb{lD|4qsmYvGF;~r0Aunc#>=c)0W4s|D{#(q9~vaX{rGms=((Wn*~LeWqIu}
zkGvlzwaxjL25hey2bVweu<xK*t+@Oa_)UKTK^x4IwmKMOjm@oL`l)}_NGPy}tdb}w
zHa>H`ji2N7m}Xsj#j7-`#=Dv}`)h&)9th^&^dR%>WH_MB8KcIXVf8p&s1xD|_k)R-
zrk$Z0-|Gf}&4Au$KhU$k?3YR5by~D9M&-q$=ocNz4!IY&p7%OxuJf&+Ei-G(23hU;
zHTLhMtjFR9ExVbPQVLzBFlROcIZ|#jmX6fm_hsVa3XP<aKAeAt8dqp&oBW=V^+d>Q
zkcNnm%Ds?ggd^Rv2~9_o82cv;p6LSBD_g_s-n1uZ8#<EeLwTm~LE9J!Zdo@M&*jFU
zoM+Z%F5)(8$8y`Wz~%Pd;Nlx@aH{<lk}}CcRMRXZMD&%Uhz3Ze$jpg#uec1IlFMPW
MDQ4iZEk#_;cNAJoqyPW_
diff --git a/plugins/kimchi/ui/pages/help/dita-help.xsl b/plugins/kimchi/ui/pages/help/dita-help.xsl
index 8583a4e..45f0a3b 100644
--- a/plugins/kimchi/ui/pages/help/dita-help.xsl
+++ b/plugins/kimchi/ui/pages/help/dita-help.xsl
@@ -9,7 +9,7 @@
<head>
<title><xsl:value-of select="/cshelp/title" /></title>
<meta charset="UTF-8" />
- <link rel="shortcut icon" href="../../images/logo.ico" />
+ <link rel="shortcut icon" href="images/logo.ico" />
<link rel="stylesheet" type="text/css" href="../kimchi.css" />
</head>
<body>
diff --git a/src/wok/config.py.in b/src/wok/config.py.in
index 5ffa936..bebe12b 100644
--- a/src/wok/config.py.in
+++ b/src/wok/config.py.in
@@ -142,6 +142,14 @@ class WokConfig(dict):
'/wok-ui.html': {
'tools.wokauth.on': True
},
+ '/favicon.ico': {
+ 'tools.staticfile.on': True,
+ 'tools.staticfile.filename': '%s/images/logo.ico' % paths.ui_dir
+ },
+ '/robots.txt': {
+ 'tools.staticfile.on': True,
+ 'tools.staticfile.filename': '%s/robots.txt' % paths.ui_dir
+ },
}
def __init__(self):
--
1.7.1
9 years, 3 months
[PATCH] [WOK] Issue #726 - solve ImportError on kimchi tests
by pvital@linux.vnet.ibm.com
From: Paulo Vital <pvital(a)linux.vnet.ibm.com>
The split of Kimchi code into Wok and Kimchi plugin modified the import
of some classes and packages and the structure of the files store in
development tree.
This patch fixes the PyhtonPath to set the correct paths and creates the
necessary symbolic links to support the tests execution.
Signed-off-by: Paulo Vital <pvital(a)linux.vnet.ibm.com>
---
plugins/kimchi/tests/Makefile.am | 4 ++++
plugins/kimchi/tests/run_tests.sh.in | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/plugins/kimchi/tests/Makefile.am b/plugins/kimchi/tests/Makefile.am
index c1f6784..1c460df 100644
--- a/plugins/kimchi/tests/Makefile.am
+++ b/plugins/kimchi/tests/Makefile.am
@@ -44,6 +44,10 @@ test_config.py: test_config.py.in Makefile
check-local:
$(MKDIR_P) $(top_srcdir)/data/screenshots
+# TODO: this is not the best way to solve the ImportError problem reported
+# in issue #726, but it solves the problem. Need think better on this.
+ test -L $(abs_top_srcdir)/../../src/wok/plugins || ln -s \
+ $(abs_top_srcdir)/.. $(abs_top_srcdir)/../../src/wok/plugins
./run_tests.sh
BUILT_SOURCES = test_config.py
diff --git a/plugins/kimchi/tests/run_tests.sh.in b/plugins/kimchi/tests/run_tests.sh.in
index beef75e..5b98755 100644
--- a/plugins/kimchi/tests/run_tests.sh.in
+++ b/plugins/kimchi/tests/run_tests.sh.in
@@ -52,4 +52,4 @@ for ((i=0;i<${#LIST[@]};i++)); do
fi
done
-PYTHONPATH=../plugins:../src:../ $CMD $OPTS ${MODEL_LIST[@]} ${MOCK_LIST[@]}
+PYTHONPATH=../../../src:../ $CMD $OPTS ${MODEL_LIST[@]} ${MOCK_LIST[@]}
--
2.4.3
9 years, 3 months
[wok] Add specific state_dir values to plugins
by Lucio Correia
The debugreports and screenshots generated were being saved to
/var/lib/wok instead of /var/lib/kimchi, due to absence of
plugin-specific state_dir config. This patch adds it.
Now, when the plugin is installed, those files are saved to
/var/lib/<plugin_name>, and, when running from source, to
plugins/<plugin_name>/data.
That also affects Ginger, which backups are now saved to
/var/lib/ginger/ginger_backups.
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
---
src/wok/config.py.in | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/wok/config.py.in b/src/wok/config.py.in
index 5ffa936..08da028 100644
--- a/src/wok/config.py.in
+++ b/src/wok/config.py.in
@@ -88,10 +88,13 @@ class PluginPaths(Paths):
self.plugin_dir = os.path.join('plugins', name)
if self.installed:
+ self.state_dir = '@localstatedir@/lib/%s' % name
self.conf_dir = '@sysconfdir(a)/wok/plugins.d'
self.src_dir = os.path.join('@wokdir@', self.plugin_dir)
self.mo_dir = '@prefix@/share/locale'
else:
+ self.state_dir = self.add_prefix(os.path.join(self.plugin_dir,
+ 'data'))
self.conf_dir = self.add_prefix(self.plugin_dir)
self.src_dir = self.add_prefix(self.plugin_dir)
self.mo_dir = self.add_prefix(os.path.join(self.plugin_dir, 'mo'))
--
1.7.1
9 years, 3 months
[wok 0/3] Fix code issues pointed by make check-local
by Lucio Correia
Lucio Correia (3):
Fix makefile to ignore Kimchi plugin
Fix unnecessary/duplicated imports
Fix PEP8 errors
Makefile.am | 2 +-
plugins/kimchi/config.py.in | 1 -
plugins/kimchi/mockmodel.py | 19 +-
plugins/kimchi/model/config.py | 2 +-
plugins/kimchi/model/cpuinfo.py | 2 +-
plugins/kimchi/model/debugreports.py | 2 +-
plugins/kimchi/model/diskutils.py | 4 +-
plugins/kimchi/model/hostdev.py | 4 +-
plugins/kimchi/model/libvirtconnection.py | 12 +-
plugins/kimchi/model/networks.py | 3 +-
plugins/kimchi/model/peers.py | 4 +-
plugins/kimchi/model/storagepools.py | 13 +-
plugins/kimchi/model/storagevolumes.py | 9 +-
plugins/kimchi/model/vms.py | 32 ++-
plugins/kimchi/model/vmstorages.py | 6 +-
plugins/kimchi/osinfo.py | 1 -
plugins/kimchi/root.py | 1 -
plugins/kimchi/screenshot.py | 2 +-
plugins/kimchi/tests/test_authorization.py | 36 ++-
plugins/kimchi/tests/test_config.py.in | 8 +-
plugins/kimchi/tests/test_exception.py | 26 ++-
plugins/kimchi/tests/test_host.py | 30 ++-
plugins/kimchi/tests/test_mock_network.py | 4 +-
plugins/kimchi/tests/test_mock_storagepool.py | 12 +-
plugins/kimchi/tests/test_mock_storagevolume.py | 8 +-
plugins/kimchi/tests/test_mockmodel.py | 6 +-
plugins/kimchi/tests/test_model.py | 24 +-
plugins/kimchi/tests/test_model_network.py | 8 +-
plugins/kimchi/tests/test_model_storagepool.py | 20 +-
plugins/kimchi/tests/test_model_storagevolume.py | 18 +-
plugins/kimchi/tests/test_plugin.py | 1 -
plugins/kimchi/tests/test_rest.py | 318 ++++++++++++++-------
plugins/kimchi/tests/test_template.py | 61 +++--
plugins/kimchi/tests/utils.py | 8 +-
plugins/kimchi/utils.py | 1 -
src/wok/cachebust.py | 2 +-
src/wok/server.py | 11 +-
src/wok/utils.py | 6 +-
38 files changed, 466 insertions(+), 261 deletions(-)
9 years, 3 months
[wok V3 0/6] Make wok branch identical to wok V3
by Lucio Correia
These changes are already included in "[PATCH V3 00/34] Split code into Wok
server and Kimchi plugin" and don't need to be reviewed again.
This patchset is just to make the upstream branch "wok" identical to
"[PATCH V3 00/34] Split code into Wok server and Kimchi plugin".
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
Lucio Correia (6):
Move back some basic UI files to wok
Renamed some moved-back kimchi-named files to wok
Unduplicate some UI files
Update makefiles to reflect UI changes
Replace kimchi by wok calls to reflect UI changes
Create an icon.css with kimchi plugin specific layout
plugins/kimchi/configure.ac | 4 -
plugins/kimchi/ui/Makefile.am | 2 +-
plugins/kimchi/ui/css/theme-default/button.css | 524 --------------------
plugins/kimchi/ui/css/theme-default/icon.css | 106 ++++
plugins/kimchi/ui/css/theme-default/message.css | 135 -----
plugins/kimchi/ui/css/theme-default/popover.css | 124 -----
plugins/kimchi/ui/images/theme-default/bg-mask.png | Bin 2899 -> 0 bytes
.../ui/images/theme-default/folder-arrow-down.png | Bin 2956 -> 0 bytes
.../kimchi/ui/images/theme-default/logo-white.png | Bin 9879 -> 0 bytes
plugins/kimchi/ui/js/Makefile.am | 4 +-
.../ui/js/src/kimchi.guest_storage_add.main.js | 4 +-
plugins/kimchi/ui/js/src/kimchi.host.js | 14 +-
.../kimchi/ui/js/src/kimchi.template_edit_main.js | 4 +-
plugins/kimchi/ui/libs/Makefile.am | 22 -
plugins/kimchi/ui/libs/themes/Makefile.am | 18 -
plugins/kimchi/ui/libs/themes/base/Makefile.am | 22 -
.../kimchi/ui/libs/themes/base/images/Makefile.am | 20 -
.../ui-bg_diagonals-thick_18_b81900_40x40.png | Bin 457 -> 0 bytes
.../ui-bg_diagonals-thick_20_666666_40x40.png | Bin 351 -> 0 bytes
.../base/images/ui-bg_flat_10_000000_40x100.png | Bin 244 -> 0 bytes
.../base/images/ui-bg_glass_100_f6f6f6_1x400.png | Bin 301 -> 0 bytes
.../base/images/ui-bg_glass_100_fdf5ce_1x400.png | Bin 387 -> 0 bytes
.../images/ui-bg_gloss-wave_35_f6a828_500x100.png | Bin 5854 -> 0 bytes
.../ui-bg_highlight-soft_100_eeeeee_1x100.png | Bin 317 -> 0 bytes
.../ui-bg_highlight-soft_75_ffe45c_1x100.png | Bin 367 -> 0 bytes
.../themes/base/images/ui-icons_228ef1_256x240.png | Bin 4599 -> 0 bytes
.../themes/base/images/ui-icons_ef8c08_256x240.png | Bin 4599 -> 0 bytes
.../themes/base/images/ui-icons_ffd27a_256x240.png | Bin 4599 -> 0 bytes
.../themes/base/images/ui-icons_ffffff_256x240.png | Bin 6468 -> 0 bytes
plugins/kimchi/ui/pages/error.html.tmpl | 69 ---
ui/css/theme-default/button.css | 85 ----
.../ui => ui}/css/theme-default/circleGauge.css | 0
.../kimchi/ui => ui}/css/theme-default/form.css | 0
.../kimchi/ui => ui}/css/theme-default/grid.css | 2 +-
.../css/theme-default/jquery-ui.custom.css | 0
.../ui => ui}/css/theme-default/line-chart.css | 0
.../ui => ui}/css/theme-default/tile-check.css | 0
.../kimchi/ui => ui}/css/theme-default/toolbar.css | 0
.../ui => ui}/images/theme-default/alert.png | Bin 3537 -> 3537 bytes
ui/images/theme-default/arrow-down.png | Bin 0 -> 537 bytes
.../ui => ui}/images/theme-default/check-green.png | Bin 3501 -> 3501 bytes
.../ui => ui}/images/theme-default/check-grey.png | Bin 3535 -> 3535 bytes
.../images/theme-default/folder-arrow-right.png | Bin 2958 -> 2958 bytes
.../ui => ui}/images/theme-default/icon-alert.png | Bin 3545 -> 3545 bytes
.../ui => ui}/images/theme-default/icon-event.png | Bin 3791 -> 3791 bytes
.../images/theme-default/icon-setting.png | Bin 3664 -> 3664 bytes
.../ui => ui}/images/theme-default/icon-tool.png | Bin 4466 -> 4466 bytes
.../ui => ui}/images/theme-default/thumb-guest.png | Bin 3896 -> 3896 bytes
.../ui => ui}/images/theme-default/thumb-host.png | Bin 5069 -> 5069 bytes
.../images/theme-default/wok-loading.gif | Bin 6181 -> 6181 bytes
.../js/src/kimchi.form.js => ui/js/src/wok.form.js | 0
.../js/src/kimchi.grid.js => ui/js/src/wok.grid.js | 10 +-
.../js/src/wok.line-chart.js | 4 +-
.../kimchi.select.js => ui/js/src/wok.select.js | 2 +-
.../kimchi/ui => ui}/js/widgets/circleGauge.js | 4 +-
.../base/images/ui-bg_glass_65_ffffff_1x400.png | Bin 246 -> 246 bytes
.../themes/base/images/ui-icons_222222_256x240.png | Bin 7006 -> 7006 bytes
57 files changed, 131 insertions(+), 1048 deletions(-)
delete mode 100644 plugins/kimchi/ui/css/theme-default/button.css
create mode 100644 plugins/kimchi/ui/css/theme-default/icon.css
delete mode 100644 plugins/kimchi/ui/css/theme-default/message.css
delete mode 100644 plugins/kimchi/ui/css/theme-default/popover.css
delete mode 100644 plugins/kimchi/ui/images/theme-default/bg-mask.png
delete mode 100644 plugins/kimchi/ui/images/theme-default/folder-arrow-down.png
delete mode 100644 plugins/kimchi/ui/images/theme-default/logo-white.png
delete mode 100644 plugins/kimchi/ui/libs/Makefile.am
delete mode 100644 plugins/kimchi/ui/libs/themes/Makefile.am
delete mode 100644 plugins/kimchi/ui/libs/themes/base/Makefile.am
delete mode 100644 plugins/kimchi/ui/libs/themes/base/images/Makefile.am
delete mode 100644 plugins/kimchi/ui/libs/themes/base/images/ui-bg_diagonals-thick_18_b81900_40x40.png
delete mode 100644 plugins/kimchi/ui/libs/themes/base/images/ui-bg_diagonals-thick_20_666666_40x40.png
delete mode 100644 plugins/kimchi/ui/libs/themes/base/images/ui-bg_flat_10_000000_40x100.png
delete mode 100644 plugins/kimchi/ui/libs/themes/base/images/ui-bg_glass_100_f6f6f6_1x400.png
delete mode 100644 plugins/kimchi/ui/libs/themes/base/images/ui-bg_glass_100_fdf5ce_1x400.png
delete mode 100644 plugins/kimchi/ui/libs/themes/base/images/ui-bg_gloss-wave_35_f6a828_500x100.png
delete mode 100644 plugins/kimchi/ui/libs/themes/base/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
delete mode 100644 plugins/kimchi/ui/libs/themes/base/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
delete mode 100644 plugins/kimchi/ui/libs/themes/base/images/ui-icons_228ef1_256x240.png
delete mode 100644 plugins/kimchi/ui/libs/themes/base/images/ui-icons_ef8c08_256x240.png
delete mode 100644 plugins/kimchi/ui/libs/themes/base/images/ui-icons_ffd27a_256x240.png
delete mode 100644 plugins/kimchi/ui/libs/themes/base/images/ui-icons_ffffff_256x240.png
delete mode 100644 plugins/kimchi/ui/pages/error.html.tmpl
rename {plugins/kimchi/ui => ui}/css/theme-default/circleGauge.css (100%)
rename {plugins/kimchi/ui => ui}/css/theme-default/form.css (100%)
rename {plugins/kimchi/ui => ui}/css/theme-default/grid.css (98%)
rename {plugins/kimchi/ui => ui}/css/theme-default/jquery-ui.custom.css (100%)
rename {plugins/kimchi/ui => ui}/css/theme-default/line-chart.css (100%)
rename {plugins/kimchi/ui => ui}/css/theme-default/tile-check.css (100%)
rename {plugins/kimchi/ui => ui}/css/theme-default/toolbar.css (100%)
rename {plugins/kimchi/ui => ui}/images/theme-default/alert.png (100%)
create mode 100644 ui/images/theme-default/arrow-down.png
rename {plugins/kimchi/ui => ui}/images/theme-default/check-green.png (100%)
rename {plugins/kimchi/ui => ui}/images/theme-default/check-grey.png (100%)
rename {plugins/kimchi/ui => ui}/images/theme-default/folder-arrow-right.png (100%)
rename {plugins/kimchi/ui => ui}/images/theme-default/icon-alert.png (100%)
rename {plugins/kimchi/ui => ui}/images/theme-default/icon-event.png (100%)
rename {plugins/kimchi/ui => ui}/images/theme-default/icon-setting.png (100%)
rename {plugins/kimchi/ui => ui}/images/theme-default/icon-tool.png (100%)
rename {plugins/kimchi/ui => ui}/images/theme-default/thumb-guest.png (100%)
rename {plugins/kimchi/ui => ui}/images/theme-default/thumb-host.png (100%)
rename plugins/kimchi/ui/images/theme-default/kimchi-loading.gif => ui/images/theme-default/wok-loading.gif (100%)
rename plugins/kimchi/ui/js/src/kimchi.form.js => ui/js/src/wok.form.js (100%)
rename plugins/kimchi/ui/js/src/kimchi.grid.js => ui/js/src/wok.grid.js (98%)
rename plugins/kimchi/ui/js/src/kimchi.line-chart.js => ui/js/src/wok.line-chart.js (98%)
rename plugins/kimchi/ui/js/src/kimchi.select.js => ui/js/src/wok.select.js (97%)
rename {plugins/kimchi/ui => ui}/js/widgets/circleGauge.js (97%)
rename {plugins/kimchi/ui => ui}/libs/themes/base/images/ui-bg_glass_65_ffffff_1x400.png (100%)
rename {plugins/kimchi/ui => ui}/libs/themes/base/images/ui-icons_222222_256x240.png (100%)
9 years, 3 months
[PATCH 0/4] Improve VM CPU update code
by Crístian Deives
This patchset refactors part of the code related to updating VM CPUs.
I am aware of two tests which are failing with this patchset. They'll be worked
on before the final version.
Crístian Deives (4):
Use locks to prevent concurrent updates to VMs
Update VCPU by using libvirt function
Set max VCPU count to the max supported value
Check if the VM update params are valid for the current state
src/kimchi/i18n.py | 3 ++-
src/kimchi/mockmodel.py | 48 ++++++++++++++------------------------
src/kimchi/model/vms.py | 62 ++++++++++++++++++++++++++++++++++++++-----------
tests/test_rest.py | 3 ++-
4 files changed, 71 insertions(+), 45 deletions(-)
--
2.4.3
9 years, 3 months
[PATCH] Disallow storage format changes in UI for templates based on image file
by Jose Ricardo Ziviani
- Only support qcow2 for VMs created by a template based on an existing
image file. This commit sets the template format type to qcow2 and
disables changes on it for such scenario.
Signed-off-by: Jose Ricardo Ziviani <joserz(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.template_edit_main.js | 37 +++++++++++++++++++++++++---------
1 file changed, 28 insertions(+), 9 deletions(-)
diff --git a/ui/js/src/kimchi.template_edit_main.js b/ui/js/src/kimchi.template_edit_main.js
index 21f5575..141e451 100644
--- a/ui/js/src/kimchi.template_edit_main.js
+++ b/ui/js/src/kimchi.template_edit_main.js
@@ -58,6 +58,14 @@ kimchi.template_edit_main = function() {
kimchi.select('template-edit-graphics-list', spiceOpt);
}
};
+ var isImageBasedTemplate = function() {
+ if (template["vm-image"] &&
+ typeof template["vm-image"] == "string" &&
+ template["vm-image"].substr(template["vm-image"].length - 4) == ".img") {
+ return true;
+ }
+ return false;
+ }
enableSpice();
var initStorage = function(result) {
var scsipools = {};
@@ -88,10 +96,16 @@ kimchi.template_edit_main = function() {
$('#selectStorageName').append(storageOptions);
// Set disk format
- $('#diskFormat').val(storageData.storageDiskFormat);
- $('#diskFormat').on('change', function() {
- $('.template-storage-disk-format').val($(this).val());
- });
+ if (isImageBasedTemplate()) {
+ $('#diskFormat').val('qcow2');
+ $('#diskFormat').prop('disabled', 'disabled');
+ }
+ else {
+ $('#diskFormat').val(storageData.storageDiskFormat);
+ $('#diskFormat').on('change', function() {
+ $('.template-storage-disk-format').val($(this).val());
+ });
+ }
$('#selectStorageName').change(function() {
var selectedItem = $(this).parent().parent();
@@ -106,16 +120,21 @@ kimchi.template_edit_main = function() {
kimchi.getStoragePoolVolume(tempStorageName, tempName[tempName.length-1], function(info) {
volSize = info.capacity / Math.pow(1024, 3);
$('.template-storage-disk', selectedItem).attr('readonly', true).val(volSize);
- $('#diskFormat').val('raw');
- $('#diskFormat').prop('disabled', true).change();
+ if (!isImageBasedTemplate()) {
+ $('#diskFormat').val('raw');
+ $('#diskFormat').prop('disabled', true).change();
+ }
});
} else if (tempType === 'logical') {
$('.template-storage-disk', selectedItem).attr('readonly', false);
- $('#diskFormat').val('raw');
- $('#diskFormat').prop('disabled', true).change();
+ if (!isImageBasedTemplate()) {
+ $('#diskFormat').val('raw');
+ $('#diskFormat').prop('disabled', true).change();
+ }
} else {
$('.template-storage-disk', selectedItem).attr('readonly', false);
- if ($('#diskFormat').prop('disabled') == true) {
+ if ($('#diskFormat').prop('disabled') == true &&
+ !isImageBasedTemplate()) {
$('#diskFormat').val('qcow2');
$('#diskFormat').prop('disabled', false).change();
}
--
1.9.1
9 years, 3 months
[PATCH v2] Issues #682/#684/#685: Change some code errors when start, shutdown or poweroff vms
by Ramon Medeiros
Changes:
v2:
Fix pep8 issues
When trying to start a running vm, shutoff or poweroff a shutdown vm,
the retrieved error was 500 (Internal Server Error). A better error
would be 400 (Invalid Request).
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
src/kimchi/model/vms.py | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/src/kimchi/model/vms.py b/src/kimchi/model/vms.py
index 106e9bc..9dfd9fe 100644
--- a/src/kimchi/model/vms.py
+++ b/src/kimchi/model/vms.py
@@ -1105,24 +1105,36 @@ class VMModel(object):
try:
dom.create()
except libvirt.libvirtError as e:
- raise OperationFailed("KCHVM0019E",
- {'name': name, 'err': e.get_error_message()})
+ # vm already running: return error 403
+ error_params = {'name': name, 'err': e.get_error_message()}
+ if DOM_STATE_MAP[dom.info()[0]] == "running":
+ raise InvalidOperation("KCHVM0019E", error_params)
+ else:
+ raise OperationFailed("KCHVM0019E", error_params)
def poweroff(self, name):
dom = self.get_vm(name, self.conn)
try:
dom.destroy()
except libvirt.libvirtError as e:
- raise OperationFailed("KCHVM0020E",
- {'name': name, 'err': e.get_error_message()})
+ # vm already powered off: return error 403
+ error_params = {'name': name, 'err': e.get_error_message()}
+ if DOM_STATE_MAP[dom.info()[0]] == "shutoff":
+ raise InvalidOperation("KCHVM0020E", error_params)
+ else:
+ raise OperationFailed("KCHVM0020E", error_params)
def shutdown(self, name):
dom = self.get_vm(name, self.conn)
try:
dom.shutdown()
except libvirt.libvirtError as e:
- raise OperationFailed("KCHVM0029E",
- {'name': name, 'err': e.get_error_message()})
+ # vm already powered off: return error 403
+ error_params = {'name': name, 'err': e.get_error_message()}
+ if DOM_STATE_MAP[dom.info()[0]] == "shutoff":
+ raise InvalidOperation("KCHVM0029E", error_params)
+ else:
+ raise OperationFailed("KCHVM0029E", error_params)
def reset(self, name):
dom = self.get_vm(name, self.conn)
--
2.1.0
9 years, 3 months