[PATCH] [Wok 0/2] SCSS and CSS updates
by sguimaraes943@gmail.com
From: Samuel Guimarães <sguimaraes943(a)gmail.com>
This patchset includes two commits that are required for existing and new features.
-First patch adds compact() function to our mixins since it was removed from python-libsass. This was generating wrong CSS outputs from different distros and rendering wrong styles (specially box-shadow effects).
-Second patch adds support for .wok-mask class with a relative position inside a panel-group, allowing us to display a "loading" text with spinning icon inside collapsible panels seen in Ginger and Gingerbase.
Both patches are required for "OVS Bridges front-end" support in Ginger and "Delete multiple Debug Reports at once" in Gingerbase.
Samuel Guimarães (2):
Added compact Sass function that was removed from libsass
Fixed .wok-mask class and loaders inside collapsable panels
ui/css/src/modules/_compact.scss | 46 ++++++++++++++++++++++++++++++++++++++++
ui/css/src/modules/_loaders.scss | 4 ++++
ui/css/src/wok.scss | 6 ++++++
ui/css/wok.css | 8 +++++++
4 files changed, 64 insertions(+)
create mode 100644 ui/css/src/modules/_compact.scss
--
1.9.3
8 years, 8 months
[PATCH] [Kimchi] Issue #919: Deactivate a storagepool makes the list of templates blank
by Jose Ricardo Ziviani
- This commit fixes cases when a storage pools is deativated or
removed. Instead of let a blank interface it displays all
templates filling the javascript field 'invalid' with the name
of the invalid storage.
Signed-off-by: Jose Ricardo Ziviani <joserz(a)linux.vnet.ibm.com>
---
i18n.py | 1 -
model/templates.py | 29 ++++++++++++++++++++---------
vmtemplate.py | 9 ++++++---
3 files changed, 26 insertions(+), 13 deletions(-)
diff --git a/i18n.py b/i18n.py
index 6214687..1061aeb 100644
--- a/i18n.py
+++ b/i18n.py
@@ -157,7 +157,6 @@ messages = {
"KCHTMPL0001E": _("Template %(name)s already exists"),
"KCHTMPL0003E": _("Network '%(network)s' specified for template %(template)s does not exist"),
"KCHTMPL0004E": _("Storage pool %(pool)s specified for template %(template)s does not exist"),
- "KCHTMPL0005E": _("Storage pool %(pool)s specified for template %(template)s is not active"),
"KCHTMPL0006E": _("Invalid parameter '%(param)s' specified for CDROM."),
"KCHTMPL0007E": _("Network %(network)s specified for template %(template)s is not active"),
"KCHTMPL0008E": _("Template name must be a string"),
diff --git a/model/templates.py b/model/templates.py
index 92705b6..9294be2 100644
--- a/model/templates.py
+++ b/model/templates.py
@@ -271,19 +271,16 @@ class LibvirtVMTemplate(VMTemplate):
# validate CPU info values - will raise appropriate exceptions
cpu_model.check_cpu_info(self.info['cpu_info'])
- def _storage_validate(self, pool_uri):
+ def _get_storage_pool(self, pool_uri):
pool_name = pool_name_from_uri(pool_uri)
try:
conn = self.conn.get()
pool = conn.storagePoolLookupByName(pool_name.encode("utf-8"))
+
except libvirt.libvirtError:
raise InvalidParameter("KCHTMPL0004E", {'pool': pool_uri,
'template': self.name})
- if not pool.isActive():
- raise InvalidParameter("KCHTMPL0005E", {'pool': pool_name,
- 'template': self.name})
-
return pool
def _get_all_networks_name(self):
@@ -295,6 +292,11 @@ class LibvirtVMTemplate(VMTemplate):
names = conn.listStoragePools() + conn.listDefinedStoragePools()
return sorted(map(lambda x: x.decode('utf-8'), names))
+ def _get_active_storagepools_name(self):
+ conn = self.conn.get()
+ names = conn.listStoragePools()
+ return sorted(map(lambda x: x.decode('utf-8'), names))
+
def _network_validate(self):
names = self.info['networks']
for name in names:
@@ -310,17 +312,26 @@ class LibvirtVMTemplate(VMTemplate):
'template': self.name})
def _get_storage_path(self, pool_uri=None):
- pool = self._storage_validate(pool_uri)
+ try:
+ pool = self._get_storage_pool(pool_uri)
+
+ except:
+ return ''
+
xml = pool.XMLDesc(0)
return xpath_get_text(xml, "/pool/target/path")[0]
def _get_storage_type(self, pool_uri=None):
- pool = self._storage_validate(pool_uri)
+ try:
+ pool = self._get_storage_pool(pool_uri)
+
+ except:
+ return ''
xml = pool.XMLDesc(0)
return xpath_get_text(xml, "/pool/@type")[0]
def _get_volume_path(self, pool, vol):
- pool = self._storage_validate(pool)
+ pool = self._get_storage_pool(pool)
try:
return pool.storageVolLookupByName(vol).path()
except:
@@ -332,7 +343,7 @@ class LibvirtVMTemplate(VMTemplate):
vol_list = self.to_volume_list(vm_uuid)
try:
for v in vol_list:
- pool = self._storage_validate(v['pool'])
+ pool = self._get_storage_pool(v['pool'])
# outgoing text to libvirt, encode('utf-8')
pool.createXML(v['xml'].encode('utf-8'), 0)
except libvirt.libvirtError as e:
diff --git a/vmtemplate.py b/vmtemplate.py
index b71cf23..4470be4 100644
--- a/vmtemplate.py
+++ b/vmtemplate.py
@@ -441,7 +441,7 @@ class VMTemplate(object):
def validate(self):
for disk in self.info.get('disks'):
pool_uri = disk.get('pool', {}).get('name')
- self._storage_validate(pool_uri)
+ self._get_storage_pool(pool_uri)
self._network_validate()
self._iso_validate()
self.cpuinfo_validate()
@@ -456,7 +456,7 @@ class VMTemplate(object):
def _network_validate(self):
pass
- def _storage_validate(self):
+ def _get_storage_pool(self):
pass
def fork_vm_storage(self, vm_uuid):
@@ -477,6 +477,9 @@ class VMTemplate(object):
def _get_all_storagepools_name(self):
return []
+ def _get_active_storagepools_name(self):
+ return []
+
def validate_integrity(self):
invalid = {}
# validate networks integrity
@@ -489,7 +492,7 @@ class VMTemplate(object):
for disk in self.info['disks']:
pool_uri = disk['pool']['name']
pool_name = pool_name_from_uri(pool_uri)
- if pool_name not in self._get_all_storagepools_name():
+ if pool_name not in self._get_active_storagepools_name():
invalid['storagepools'] = [pool_name]
# validate iso integrity
--
1.9.1
8 years, 8 months
[PATCH] [Kimchi] Issue #924: Before deleting a storagepool, kimchi should check if any template is using that
by Jose Ricardo Ziviani
---
model/storagepools.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/model/storagepools.py b/model/storagepools.py
index cf3ed21..4a0d34c 100644
--- a/model/storagepools.py
+++ b/model/storagepools.py
@@ -33,6 +33,7 @@ from wok.plugins.kimchi.model.host import DeviceModel
from wok.plugins.kimchi.model.libvirtstoragepool import StoragePoolDef
from wok.plugins.kimchi.osinfo import defaults as tmpl_defaults
from wok.plugins.kimchi.scan import Scanner
+from wok.plugins.kimchi.utils import pool_name_from_uri
ISO_POOL_NAME = u'kimchi_isos'
@@ -437,7 +438,7 @@ class StoragePoolModel(object):
t_info = session.get('template', tmpl)
for disk in t_info['disks']:
t_pool = disk['pool']['name']
- if t_pool == pool_name:
+ if pool_name_from_uri(t_pool) == pool_name:
return True
return False
--
1.9.1
8 years, 8 months
[PATCH] [Kimchi] Adjust UI to create Template according to the lastest API changes
by Aline Manera
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.template_add_main.js | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/ui/js/src/kimchi.template_add_main.js b/ui/js/src/kimchi.template_add_main.js
index 3146f49..fa5c847 100644
--- a/ui/js/src/kimchi.template_add_main.js
+++ b/ui/js/src/kimchi.template_add_main.js
@@ -313,7 +313,7 @@ kimchi.template_add_main = function() {
return;
}
var data = {
- "cdrom": isoFile
+ "source_media": isoFile
};
addTemplate(data);
});
@@ -531,9 +531,7 @@ kimchi.template_add_main = function() {
$('#vm-image-local-box-button').text(i18n['KCHAPI6008M']);
$('#vm-image-local-box-button').prop('disabled', true);
addTemplate({
- disks: [{
- base: $('input', '#vm-image-local-box').val()
- }]
+ source_media: $('input', '#vm-image-local-box').val()
}, function() {
$('input', '#vm-image-local-box').prop('disabled', false);
$('#vm-image-local-box-button').text(i18n['KCHAPI6005M']);
@@ -548,7 +546,7 @@ kimchi.template_add_main = function() {
return;
}
var data = {
- "cdrom": isoUrl
+ "source_media": isoUrl
};
addTemplate(data);
});
@@ -579,7 +577,7 @@ kimchi.template_add_main = function() {
var data = {
"os_distro": isoInfo.os_distro,
"os_version": isoInfo.os_version,
- "cdrom": isoInfo.path
+ "source_media": isoInfo.path
};
kimchi.createTemplate(data, function() {
successNum++;
--
2.5.5
8 years, 8 months
[PATCH][Kimchi] Change "Memory Available" by "Memory Utilization"
by Rodrigo Trujillo
Guests gallery and list view were display different labels.
Just fix it.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
ui/pages/guest.html.tmpl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/pages/guest.html.tmpl b/ui/pages/guest.html.tmpl
index c8f32a9..c89e450 100644
--- a/ui/pages/guest.html.tmpl
+++ b/ui/pages/guest.html.tmpl
@@ -92,7 +92,7 @@
<div class="progress-bar light-grey memory"></div>
<div class="progress-bar memory-progress-bar"></div>
</div><!--
- --><span class="item-hidden">$_("Memory Available")</span>
+ --><span class="item-hidden">$_("Memory Utilization")</span>
</span><!--
--><span class='column-storage'>
<div class='measure-label storage-percentage'></div>
--
2.1.0
8 years, 8 months
[PATCH] [Kimchi] Replace backing image by clone when using template based on existing img
by Jose Ricardo Ziviani
- This commit replaces the current backing image to a complete clone
when using a template based on an existing template.
Signed-off-by: Jose Ricardo Ziviani <joserz(a)linux.vnet.ibm.com>
---
model/templates.py | 17 ++++++++++++++++-
vmtemplate.py | 8 --------
2 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/model/templates.py b/model/templates.py
index 1e6ad30..87173d1 100644
--- a/model/templates.py
+++ b/model/templates.py
@@ -361,7 +361,22 @@ class LibvirtVMTemplate(VMTemplate):
for v in vol_list:
pool = self._get_storage_pool(v['pool'])
# outgoing text to libvirt, encode('utf-8')
- pool.createXML(v['xml'].encode('utf-8'), 0)
+ if 'base' in v and 'path' in v['base']:
+ conn = self.conn.get()
+ try:
+ volume_base = conn.storageVolLookupByPath(
+ v['base']['path'])
+
+ except libvirt.libvirtError as e:
+ pool.createXML(v['xml'].encode('utf-8'), 0)
+ continue
+
+ pool.createXMLFrom(v['xml'].encode('utf-8'),
+ volume_base,
+ 0)
+ else:
+ pool.createXML(v['xml'].encode('utf-8'), 0)
+
except libvirt.libvirtError as e:
raise OperationFailed("KCHVMSTOR0008E", {'error': e.message})
return vol_list
diff --git a/vmtemplate.py b/vmtemplate.py
index a223beb..4ce5d19 100644
--- a/vmtemplate.py
+++ b/vmtemplate.py
@@ -264,14 +264,6 @@ class VMTemplate(object):
v_tree.append(E.capacity(str(info['capacity']), unit='G'))
target_fmt = info['format']
- if 'base' in d:
- # target must be qcow2 in order to use a backing file
- target_fmt = 'qcow2'
-
- v_tree.append(E.backingStore(
- E.path(info['base']['path']),
- E.format(type=info['base']['format'])))
-
target = E.target(
E.format(type=target_fmt), E.path(info['path']))
v_tree.append(target)
--
1.9.1
8 years, 8 months
[PATCH] [Kimchi 0/2] Fix issues 920 and 923
by Jose Ricardo Ziviani
This patchset fixes the issues 920 and 923.
Depends on patches:
Issue #919: Deactivate a storagepool makes the list of templates blank
[Wok] Implement update methods for object store
Jose Ricardo Ziviani (2):
Issue #920: Template is removed if an ISO doesn't exist
Issue #923: Template always shows VNC, even if I save Spice in my
template
i18n.py | 2 ++
model/templates.py | 42 +++++++++++++++++++++++-----------
ui/js/src/kimchi.template_edit_main.js | 12 ++++++++--
3 files changed, 41 insertions(+), 15 deletions(-)
--
1.9.1
8 years, 8 months
[PATCH] [Wok 0/3] Implement Asynchronous Notifications frontend
by Lucio Correia
This patchset depends on Asynchronous Notification backend.
Lucio Correia (3):
Implement notifications JS API
Implement wok.notification widget
Implement notifications loop
ui/js/src/wok.api.js | 18 ++++++++++++++++++
ui/js/src/wok.main.js | 5 +++++
ui/js/src/wok.notification.js | 36 ++++++++++++++++++++++++++++++++++++
ui/js/src/wok.utils.js | 19 +++++++++++++++++++
4 files changed, 78 insertions(+)
create mode 100644 ui/js/src/wok.notification.js
--
1.9.1
8 years, 8 months
[PATCH] [Wok] wok.conf - comment update
by sureshab@linux.vnet.ibm.com
From: Suresh Babu Angadi <sureshab(a)in.ibm.com>
updated wok.conf with more detailed comment for SSL certificate
Signed-off-by: Suresh Babu Angadi <sureshab(a)in.ibm.com>
---
src/wok.conf.in | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/wok.conf.in b/src/wok.conf.in
index 77a79b6..b55cd0b 100644
--- a/src/wok.conf.in
+++ b/src/wok.conf.in
@@ -22,8 +22,11 @@
# Port for websocket proxy to listen on
#websockets_port = 64667
-# The full path to an SSL Certificate in PEM format. If left unspecified,
-# Wok will generate a self-signed certificate automatically.
+# The full path to an SSL Certificate, or chain of certificates in
+# PEM format. When a chain is used, the server's certificate must be
+# the first certificate in the file, with the chain concatenated onto
+# the end of that certificate. If left unspecified, Wok will generate
+# a self-signed certificate automatically.
#ssl_cert =
# The corresponding private key in PEM format for the SSL Certificate supplied
--
2.1.0
8 years, 8 months
[PATCH V2] [Wok 0/3] Implement Asynchronous Notifications frontend
by Lucio Correia
Changes in V2:
- replaced wok.notification by wok.message.notify
Lucio Correia (3):
Implement notifications JS API
Implement wok.message.notify
Implement notifications loop
ui/js/src/wok.api.js | 18 ++++++++++++++++++
ui/js/src/wok.main.js | 5 +++++
ui/js/src/wok.message.js | 8 ++++++--
ui/js/src/wok.utils.js | 19 +++++++++++++++++++
4 files changed, 48 insertions(+), 2 deletions(-)
--
1.9.1
8 years, 8 months