[PATCH] bug fix: Only check for ISO images in active pools
by Aline Manera
From: Aline Manera <alinefm(a)br.ibm.com>
The wrong exception was expected while searching for ISO files in the storage
pools.
Independent of the exception raised it should not block users to create
a template, so use the generic Exception to catch any error.
Fix it to avoit the error below.
Request Headers:
COOKIE: kimchi=a50f5cb488c331754db1a642eaba89f7fe71c0b8;
userid=alinefm
HOST: localhost:8000
CONNECTION: keep-alive
Remote-Addr: 127.0.0.1
ACCEPT: application/json, text/javascript, */*; q=0.01
USER-AGENT: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:27.0)
Gecko/20100101 Firefox/27.0
X-REQUESTED-WITH: XMLHttpRequest
ACCEPT-LANGUAGE: en-us,en;q=0.7,pt-br;q=0.3
Content-Type: application/json
REFERER: http://localhost:8000/
ACCEPT-ENCODING: gzip, deflate
[28/Feb/2014:12:27:50] HTTP Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/cherrypy/_cprequest.py", line 656, in respond
response.body = self.handler()
File "/usr/lib/python2.7/dist-packages/cherrypy/lib/encoding.py", line 188, in __call__
self.body = self.oldhandler(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/cherrypy/_cpdispatch.py", line 34, in __call__
return self.callable(*self.args, **self.kwargs)
File "/home/alinefm/kimchi/src/kimchi/control/base.py", line 274, in index
return self.get(filter_params)
File "/home/alinefm/kimchi/src/kimchi/control/storagevolumes.py", line 71, in get
res_list = get_list(*self.model_args)
File "/home/alinefm/kimchi/src/kimchi/model/storagevolumes.py", line 170, in get_list
pool.refresh(0)
File "/home/alinefm/kimchi/src/kimchi/model/libvirtconnection.py", line 62, in wrapper
ret = f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/libvirt.py", line 2220, in refresh
if ret == -1: raise libvirtError ('virStoragePoolRefresh() failed', pool=self)
libvirtError: Requested operation is not valid: storage pool is not active
Signed-off-by: Aline Manera <alinefm(a)br.ibm.com>
---
src/kimchi/model/storagevolumes.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/kimchi/model/storagevolumes.py b/src/kimchi/model/storagevolumes.py
index 8defdb7..3e21268 100644
--- a/src/kimchi/model/storagevolumes.py
+++ b/src/kimchi/model/storagevolumes.py
@@ -169,7 +169,7 @@ class IsoVolumesModel(object):
pool = StoragePoolModel.get_storagepool(pool_name, self.conn)
pool.refresh(0)
volumes = pool.listVolumes()
- except InvalidOperation:
+ except Exception:
# Skip inactive pools
continue
--
1.7.10.4
10 years, 9 months
[PATCH 0/2] bug fix: Enable NFS path field when a NFS server is provided
by Aline Manera
From: Aline Manera <alinefm(a)br.ibm.com>
Aline Manera (2):
bug fix: Enable NFS path field when a NFS server is provided
Fix typo on KCHAPI6005E message
po/en_US.po | 24 ++++++++++++++++++++++--
po/kimchi.pot | 24 ++++++++++++++++++++++--
po/pt_BR.po | 24 ++++++++++++++++++++++--
po/zh_CN.po | 24 ++++++++++++++++++++++--
ui/js/src/kimchi.storagepool_add_main.js | 2 +-
ui/pages/i18n.html.tmpl | 2 +-
6 files changed, 90 insertions(+), 10 deletions(-)
--
1.7.10.4
10 years, 9 months
[PATCH] Fix software update action into Host resource
by Paulo Vital
Previous change on how to handle the update packages action
forgot to add some necessary parameters to work in UI.
Whitout this patch no action will be exectued when clicking on
"Update All" buttons from Hongliang Wang's patch: "UI: Software
Update Support".
Signed-off-by: Paulo Vital <pvital(a)linux.vnet.ibm.com>
---
src/kimchi/model/host.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/kimchi/model/host.py b/src/kimchi/model/host.py
index d0d2190..a7db7c9 100644
--- a/src/kimchi/model/host.py
+++ b/src/kimchi/model/host.py
@@ -44,6 +44,8 @@ HOST_STATS_INTERVAL = 1
class HostModel(object):
def __init__(self, **kargs):
self.conn = kargs['conn']
+ self.objstore = kargs['objstore']
+ self.task = TaskModel(**kargs)
self.host_info = self._get_host_info()
def _get_host_info(self):
--
1.8.3.1
10 years, 9 months
[PATCH 0/2 V2] Fix VM's network model template for Power systems.
by Paulo Vital
This patchset setup the network model to 'spapr-vlan' by default in those old
distro vesions for new Power guests, creates a new format to modern distro
versions dictionary and setup the modern distro version for Power guests:
RHEL7.0 and Fedora 19.
Also, fix the testcase that checks osinfo information to use the new modern
distro versions dictionary and fixed PEP8 to this file.
Paulo Vital (2):
Fix VM's network model template for Power systems.
Fix test_osinfo.py to use new modern distro version dict.
Makefile.am | 1 +
src/kimchi/osinfo.py | 14 ++++++++------
tests/test_osinfo.py | 9 +++++----
3 files changed, 14 insertions(+), 10 deletions(-)
--
1.8.3.1
10 years, 9 months
[PATCH 0/5] Fix VM error messages handling
by Rodrigo Trujillo
The Guest tab was not showing backend error messages properly. So user was
not able to know what happened if a VM failed to start, stop, reset or delete.
In order to fix this, both backend and frontend had to be changed.
Rodrigo Trujillo (5):
Fix vm start UI error return message
Fix VM stop error messages handling (backend/UI)
Fix VM reset (UI) error messages hnadling
Fix VM delete error message handling (UI/Backend)
Delete unsed _vm_exists funtion
src/kimchi/i18n.py | 2 ++
src/kimchi/model/vms.py | 51 ++++++++++++++++++++----------------------
ui/js/src/kimchi.guest_main.js | 26 ++++++++++-----------
ui/pages/i18n.html.tmpl | 1 +
4 files changed, 40 insertions(+), 40 deletions(-)
--
1.8.5.3
10 years, 9 months
[PATCH] kimchi.control.utils: fix request parsing in generate_action_handler()
by zhshzhou@linux.vnet.ibm.com
From: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
generate_action_handler() parses the request and collects the action
arguments. The problem is it calls parse_request() in a generation
expression. This implies parse_request() is called for each action
argument. However parse_request() should be called only once, because it
reads over the request body and turns it to a dict. When it is called a
second time, the request body is already over, so parse_request() fails.
This patch stores the result from parse_request() in a variable, and
uses the variable in the generation expression.
Signed-off-by: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
---
src/kimchi/control/base.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/control/base.py b/src/kimchi/control/base.py
index 61b4341..48f1949 100644
--- a/src/kimchi/control/base.py
+++ b/src/kimchi/control/base.py
@@ -65,8 +65,8 @@ class Resource(object):
try:
model_args = list(self.model_args)
if action_args is not None:
- model_args.extend(parse_request()[key]
- for key in action_args)
+ request = parse_request()
+ model_args.extend(request[key] for key in action_args)
fn = getattr(self.model, model_fn(self, action_name))
ident = fn(*model_args)
self._redirect(ident)
--
1.8.5.3
10 years, 9 months
[PATCH] UI: template support spice
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
The backend already support spice.
Just need to add a graphics selection in template edit page.
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.template_edit_main.js | 14 ++++++++++++--
ui/pages/template-edit.html.tmpl | 15 +++++++++++++++
2 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/ui/js/src/kimchi.template_edit_main.js b/ui/js/src/kimchi.template_edit_main.js
index 17e9a41..c2fea31 100644
--- a/ui/js/src/kimchi.template_edit_main.js
+++ b/ui/js/src/kimchi.template_edit_main.js
@@ -22,10 +22,16 @@ kimchi.template_edit_main = function() {
kimchi.retrieveTemplate(kimchi.selectedTemplate, function(template) {
origDisks = template.disks;
for ( var prop in template) {
- $('input[name="' + prop + '"]', templateEditForm).val(template[prop]);
+ value = template[prop];
+ if (prop == 'graphics') {
+ value = value["type"];
+ }
+ $('input[name="' + prop + '"]', templateEditForm).val(value);
}
var disks = template.disks;
$('input[name="disks"]').val(disks[0].size);
+ var options = [{label: 'vnc', value: 'vnc'}, {label: 'spice', value: 'spice'}];
+ kimchi.select('template-edit-graphics-list', options);
kimchi.listStoragePools(function(result) {
var options = [];
if (result && result.length) {
@@ -67,7 +73,7 @@ kimchi.template_edit_main = function() {
});
$('#tmpl-edit-button-save').on('click', function() {
- var editableFields = [ 'name', 'cpus', 'memory', 'storagepool', 'disks'];
+ var editableFields = [ 'name', 'cpus', 'memory', 'storagepool', 'disks', 'graphics'];
var data = {};
$.each(editableFields, function(i, field) {
/* Support only 1 disk at this moment */
@@ -75,6 +81,10 @@ kimchi.template_edit_main = function() {
origDisks[0].size = Number($('#form-template-edit [name="' + field + '"]').val());
data[field] = origDisks;
}
+ else if (field == 'graphics') {
+ var type = $('#form-template-edit [name="' + field + '"]').val();
+ data[field] = {'type': type};
+ }
else {
data[field] = $('#form-template-edit [name="' + field + '"]').val();
}
diff --git a/ui/pages/template-edit.html.tmpl b/ui/pages/template-edit.html.tmpl
index 6056997..0f663d4 100644
--- a/ui/pages/template-edit.html.tmpl
+++ b/ui/pages/template-edit.html.tmpl
@@ -91,6 +91,21 @@
</div>
<div>
<div class="template-edit-wrapper-label">
+ <label>$_("graphics")</label>
+ </div>
+ <div class="template-edit-wrapper-controls">
+ <div class="btn dropdown popable">
+ <input id="template-edit-graphics" name="graphics" type="hidden" />
+ <span class="text" id="template-edit-graphics-label"></span><span class="arrow"></span>
+ <div class="popover" style="width: 100%">
+ <ul class="select-list" id="template-edit-graphics-list" data-target="template-edit-graphics" data-label="template-edit-graphics-label">
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div>
+ <div class="template-edit-wrapper-label">
<label>$_("Storage Pool")</label>
</div>
<div class="template-edit-wrapper-controls">
--
1.8.4.2
10 years, 9 months