[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] Issue 299 Inactive storage pools are listed while editing template
by Adam King
Omit any inactive pools from the template edit pool selection list.
Signed-off-by: Adam King <rak(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.storagepool_add_main.js | 2 +-
ui/js/src/kimchi.template_edit_main.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ui/js/src/kimchi.storagepool_add_main.js b/ui/js/src/kimchi.storagepool_add_main.js
index 63c6d11..5960c8d 100644
--- a/ui/js/src/kimchi.storagepool_add_main.js
+++ b/ui/js/src/kimchi.storagepool_add_main.js
@@ -140,7 +140,7 @@ kimchi.validateForm = function() {
kimchi.message.error.code('KCHPOOL6001E');
return false;
}
- if (name.contains("/")) {
+ if (name.indexOf("/")!=-1) {
kimchi.message.error.code('KCHPOOL6004E');
return false;
}
diff --git a/ui/js/src/kimchi.template_edit_main.js b/ui/js/src/kimchi.template_edit_main.js
index 5a928ae..17e9a41 100644
--- a/ui/js/src/kimchi.template_edit_main.js
+++ b/ui/js/src/kimchi.template_edit_main.js
@@ -30,7 +30,7 @@ kimchi.template_edit_main = function() {
var options = [];
if (result && result.length) {
$.each(result, function(index, storagePool) {
- if(storagePool.type !== 'kimchi-iso') {
+ if ((storagePool.state=="active") && (storagePool.type !== 'kimchi-iso')) {
options.push({
label: storagePool.name,
value: '/storagepools/' + storagePool.name
--
1.8.1.4
10 years, 10 months
[PATCH 0/2] Github bug #307: Add storage pool list
by Daniel Barboza
From: Daniel Henrique Barboza <danielhb(a)linux.vnet.ibm.com>
These patches fixes the bug where the list of storage pool
types can take a long time to appear. The solution used here
is to detach the view of such list with the return of the
JSON that loads the partition data.
To test this patch I recomend doing the following change in
src/kimchi/model/hosts.py:
+ import time
class PartitionsModel(object):
def __init__(self, **kargs):
pass
def get_list(self):
+ time.sleep(10)
result = disks.get_partitions_names()
return result
The sleep(10) call will ensure that get_list (which returns the
partition data) will take at least 10 seconds to execute. It is
enough time to select the LOGICAL type and see how the UI is
working before and after the JSON call.
Daniel Henrique Barboza (2):
Github bug #307: add storage pool type list - JS changes
Github bug #307: storage pool type list - html and string changes
po/en_US.po | 21 +++-
po/kimchi.pot | 20 +++-
po/pt_BR.po | 21 +++-
po/zh_CN.po | 21 +++-
ui/js/src/kimchi.storagepool_add_main.js | 177 ++++++++++++++++---------------
ui/pages/i18n.html.tmpl | 4 +-
ui/pages/storagepool-add.html.tmpl | 7 +-
7 files changed, 177 insertions(+), 94 deletions(-)
--
1.8.3.1
10 years, 10 months
[PATCH 0/4] Add users and groups to VMs
by Crístian Viana
Crístian Viana (4):
Override only the updated "User" methods in "patch_auth"
Add functions to check if a user/group exists
Return users and groups when fetching VM info
Add/remove users and groups to VMs
docs/API.md | 6 +++++
src/kimchi/API.json | 22 ++++++++++++++++
src/kimchi/auth.py | 22 ++++++++++++++++
src/kimchi/control/vms.py | 6 +++--
src/kimchi/i18n.py | 6 +++++
src/kimchi/mockmodel.py | 4 ++-
src/kimchi/model/vms.py | 61 ++++++++++++++++++++++++++++++++++++++++++---
tests/test_authorization.py | 19 ++++++++++++++
tests/test_mockmodel.py | 2 +-
tests/test_model.py | 44 +++++++++++++++++++++++++++++++-
tests/test_rest.py | 2 ++
tests/utils.py | 24 +++++-------------
12 files changed, 191 insertions(+), 27 deletions(-)
--
1.8.5.3
10 years, 10 months
Kimchi is growing!!
by Aline Manera
Hi all,
I have some good news to share with you.
Adam King has just caught my attention to the image below.
Yeap! 1000 commits! A big accomplishment that was only possible with
everyone working together.
And Paulo found out Kimchi is on Linux Foundation.
Mentioning Paulo:
/"Last week I received a newsletter with some Linux Foundation training
sessions [1], and one of them,
Linux KVM Virtualization (LFS540), caught my attention by listing Kimchi
as one of the OSS "quick start"
tools [2].//"
//
//Yes guys, Kimchi is growing. Let's take over the world!!! :-D//
//
//Pinky: "Gee, Brain, what do you want to do tonight?"//
//The Brain: "The same thing we do every night, Pinky---try to take over
the world!" //
/
[1] http://training.linuxfoundation.org
[2]
http://training.linuxfoundation.org/linux-courses/linux-kvm-virtualizatio...
Seems more and more we are becoming visible to the world!
Great job team!
Regards,
Aline Manera
PNG
10 years, 10 months
[PATCH] issue #242: Do not allow user deactivate/delete storage pool used by a template
by Aline Manera
From: Aline Manera <alinefm(a)br.ibm.com>
Make a integrity verification when user try to deactivate or delete a pool.
If pool is used by a template it should not be deactivated or deleted to
avoid problems while using the template.
Also update the po files as new messages are added to alert the user.
Signed-off-by: Aline Manera <alinefm(a)br.ibm.com>
---
po/en_US.po | 66 +++++++++++++++++++++++++++-----------
po/kimchi.pot | 57 ++++++++++++++++++++++++--------
po/pt_BR.po | 66 +++++++++++++++++++++++++++-----------
po/zh_CN.po | 65 ++++++++++++++++++++++++++-----------
src/kimchi/i18n.py | 2 ++
src/kimchi/model/storagepools.py | 21 ++++++++++--
tests/test_model.py | 5 +++
7 files changed, 210 insertions(+), 72 deletions(-)
diff --git a/po/en_US.po b/po/en_US.po
index ca1fe86..aeff16e 100644
--- a/po/en_US.po
+++ b/po/en_US.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-02-20 15:26-0300\n"
+"POT-Creation-Date: 2014-02-25 15:23-0300\n"
"PO-Revision-Date: 2013-07-11 17:32-0400\n"
"Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
"Language-Team: English\n"
@@ -85,18 +85,21 @@ msgstr "Cancel"
msgid "Save"
msgstr "Save"
-msgid "Reset"
-msgstr "Reset"
-
msgid "Start"
msgstr "Start"
+msgid "Reset"
+msgstr "Reset"
+
msgid "Stop"
msgstr "Stop"
msgid "Actions"
msgstr "Actions"
+msgid "Console"
+msgstr ""
+
msgid "Edit"
msgstr "Edit"
@@ -237,6 +240,9 @@ msgstr "Remove"
msgid "Download"
msgstr "Download"
+msgid "Report name should contain only letters, digits and/or hyphen ('-')."
+msgstr ""
+
msgid ""
"This will delete the virtual machine and its virtual disks. This operation "
"cannot be undone. Would you like to continue?"
@@ -299,12 +305,12 @@ msgstr "Server name can not be blank."
msgid "This is not a valid Server Name or IP. please, modify it."
msgstr "This is not a valid Server Name or IP. please, modify it."
-msgid "Log out"
-msgstr "Log out"
-
msgid "Help"
msgstr ""
+msgid "Log out"
+msgstr "Log out"
+
msgid "Log In"
msgstr "Log In"
@@ -322,12 +328,8 @@ msgstr "Report Name"
msgid ""
"The name used to identify the report. If omitted, a name will be chosen "
-"based on current time. Name can contain: letters, digits, \"-\", \"_\", or "
-"\".\"."
+"based on current time. Name can contain: letters, digits and hyphen (\"-\")."
msgstr ""
-"The name used to identify the report. If omitted, a name will be chosen "
-"based on current time. Name can contain: letters, digits, \"-\", \"_\", or "
-"\".\"."
msgid "Define a New Storage Pool"
msgstr "Define a New Storage Pool"
@@ -400,12 +402,12 @@ msgstr "iSCSI Authentication"
msgid "CPU"
msgstr "CPU"
-msgid "Network I/O"
-msgstr "Network I/O"
-
msgid "Disk I/O"
msgstr "Disk I/O"
+msgid "Network I/O"
+msgstr "Network I/O"
+
msgid "Livetile"
msgstr "Livetile"
@@ -741,6 +743,10 @@ msgid ""
msgstr ""
#, python-format
+msgid "Unable to start virtual machine %(name)s. Details: %(err)s"
+msgstr ""
+
+#, python-format
msgid "Interface %(iface)s does not exist in virtual machine %(name)s"
msgstr ""
@@ -936,6 +942,18 @@ msgstr ""
msgid "The SCSI host adapter name must be a string."
msgstr ""
+msgid "The storage pool kimchi_isos is reserved for internal use"
+msgstr ""
+
+#, python-format
+msgid ""
+"Unable to deactivate pool %(name)s as it is associated with some templates"
+msgstr ""
+
+#, python-format
+msgid "Unable to delete pool %(name)s as it is associated with some templates"
+msgstr ""
+
#, python-format
msgid "Storage volume %(name)s already exists"
msgstr ""
@@ -1081,6 +1099,13 @@ msgstr ""
msgid "Unable to generate debug report %(name)s. Details: %(err)s"
msgstr ""
+msgid "You should give a name for the debug file report."
+msgstr ""
+
+msgid ""
+"Name should be a string. Only letters, digits and hyphen ('-') are allowed."
+msgstr ""
+
#, python-format
msgid "Storage server %(server)s was not used by Kimchi"
msgstr ""
@@ -1139,16 +1164,13 @@ msgid "Invalid storage type. Types supported: 'cdrom'"
msgstr ""
#, python-format
-msgid "The path %(value)s is not valid local/remote path for the device"
+msgid "The path '%(value)s' is not valid local/remote path for the device"
msgstr ""
#, python-format
msgid "Device name %(dev_name)s already exists in vm %(vm_name)s"
msgstr ""
-msgid "Must specify a device name"
-msgstr ""
-
msgid "Can't specify a directory for a CDROM device path"
msgstr ""
@@ -1171,6 +1193,12 @@ msgstr ""
msgid "Do not support guest CDROM hot plug attachment"
msgstr ""
+msgid "Specify type and path to add a new virtual machine disk"
+msgstr ""
+
+msgid "Specify path to update virtual machine disk"
+msgstr ""
+
msgid "Repository ID must be one word only string."
msgstr ""
diff --git a/po/kimchi.pot b/po/kimchi.pot
index a906ad9..abb7219 100755
--- a/po/kimchi.pot
+++ b/po/kimchi.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-02-20 15:26-0300\n"
+"POT-Creation-Date: 2014-02-25 15:23-0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL(a)li.org>\n"
@@ -85,10 +85,10 @@ msgstr ""
msgid "Save"
msgstr ""
-msgid "Reset"
+msgid "Start"
msgstr ""
-msgid "Start"
+msgid "Reset"
msgstr ""
msgid "Stop"
@@ -97,6 +97,9 @@ msgstr ""
msgid "Actions"
msgstr ""
+msgid "Console"
+msgstr ""
+
msgid "Edit"
msgstr ""
@@ -233,6 +236,9 @@ msgstr ""
msgid "Download"
msgstr ""
+msgid "Report name should contain only letters, digits and/or hyphen ('-')."
+msgstr ""
+
msgid ""
"This will delete the virtual machine and its virtual disks. This operation "
"cannot be undone. Would you like to continue?"
@@ -291,10 +297,10 @@ msgstr ""
msgid "This is not a valid Server Name or IP. please, modify it."
msgstr ""
-msgid "Log out"
+msgid "Help"
msgstr ""
-msgid "Help"
+msgid "Log out"
msgstr ""
msgid "Log In"
@@ -314,8 +320,7 @@ msgstr ""
msgid ""
"The name used to identify the report. If omitted, a name will be chosen "
-"based on current time. Name can contain: letters, digits, \"-\", \"_\", or "
-"\".\"."
+"based on current time. Name can contain: letters, digits and hyphen (\"-\")."
msgstr ""
msgid "Define a New Storage Pool"
@@ -385,10 +390,10 @@ msgstr ""
msgid "CPU"
msgstr ""
-msgid "Network I/O"
+msgid "Disk I/O"
msgstr ""
-msgid "Disk I/O"
+msgid "Network I/O"
msgstr ""
msgid "Livetile"
@@ -726,6 +731,10 @@ msgid ""
msgstr ""
#, python-format
+msgid "Unable to start virtual machine %(name)s. Details: %(err)s"
+msgstr ""
+
+#, python-format
msgid "Interface %(iface)s does not exist in virtual machine %(name)s"
msgstr ""
@@ -921,6 +930,18 @@ msgstr ""
msgid "The SCSI host adapter name must be a string."
msgstr ""
+msgid "The storage pool kimchi_isos is reserved for internal use"
+msgstr ""
+
+#, python-format
+msgid ""
+"Unable to deactivate pool %(name)s as it is associated with some templates"
+msgstr ""
+
+#, python-format
+msgid "Unable to delete pool %(name)s as it is associated with some templates"
+msgstr ""
+
#, python-format
msgid "Storage volume %(name)s already exists"
msgstr ""
@@ -1066,6 +1087,13 @@ msgstr ""
msgid "Unable to generate debug report %(name)s. Details: %(err)s"
msgstr ""
+msgid "You should give a name for the debug file report."
+msgstr ""
+
+msgid ""
+"Name should be a string. Only letters, digits and hyphen ('-') are allowed."
+msgstr ""
+
#, python-format
msgid "Storage server %(server)s was not used by Kimchi"
msgstr ""
@@ -1124,16 +1152,13 @@ msgid "Invalid storage type. Types supported: 'cdrom'"
msgstr ""
#, python-format
-msgid "The path %(value)s is not valid local/remote path for the device"
+msgid "The path '%(value)s' is not valid local/remote path for the device"
msgstr ""
#, python-format
msgid "Device name %(dev_name)s already exists in vm %(vm_name)s"
msgstr ""
-msgid "Must specify a device name"
-msgstr ""
-
msgid "Can't specify a directory for a CDROM device path"
msgstr ""
@@ -1156,6 +1181,12 @@ msgstr ""
msgid "Do not support guest CDROM hot plug attachment"
msgstr ""
+msgid "Specify type and path to add a new virtual machine disk"
+msgstr ""
+
+msgid "Specify path to update virtual machine disk"
+msgstr ""
+
msgid "Repository ID must be one word only string."
msgstr ""
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 715e072..db7c579 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 1.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-02-20 15:26-0300\n"
+"POT-Creation-Date: 2014-02-25 15:23-0300\n"
"PO-Revision-Date: 2013-06-27 10:48+0000\n"
"Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
"Language-Team: Aline Manera <alinefm(a)br.ibm.com>\n"
@@ -101,18 +101,21 @@ msgstr "Cancelar"
msgid "Save"
msgstr "Salvar"
-msgid "Reset"
-msgstr "Reiniciar"
-
msgid "Start"
msgstr "Iniciar"
+msgid "Reset"
+msgstr "Reiniciar"
+
msgid "Stop"
msgstr "Parar"
msgid "Actions"
msgstr "Ações"
+msgid "Console"
+msgstr ""
+
msgid "Edit"
msgstr "Editar"
@@ -255,6 +258,9 @@ msgstr "Remover"
msgid "Download"
msgstr "Baixar"
+msgid "Report name should contain only letters, digits and/or hyphen ('-')."
+msgstr ""
+
msgid ""
"This will delete the virtual machine and its virtual disks. This operation "
"cannot be undone. Would you like to continue?"
@@ -317,12 +323,12 @@ msgstr ""
msgid "This is not a valid Server Name or IP. please, modify it."
msgstr ""
-msgid "Log out"
-msgstr "Sair"
-
msgid "Help"
msgstr ""
+msgid "Log out"
+msgstr "Sair"
+
msgid "Log In"
msgstr "Entrar"
@@ -340,12 +346,8 @@ msgstr "Nome do Relatório"
msgid ""
"The name used to identify the report. If omitted, a name will be chosen "
-"based on current time. Name can contain: letters, digits, \"-\", \"_\", or "
-"\".\"."
+"based on current time. Name can contain: letters, digits and hyphen (\"-\")."
msgstr ""
-"O nome usado para identificar o relatório. Se omitido, o nome será escolhido "
-"baseado no horário. O nome pode conter: letras, números, \"-\", \"_\", ou \"."
-"\"."
msgid "Define a New Storage Pool"
msgstr "Definir novo Storage Pool"
@@ -415,12 +417,12 @@ msgstr ""
msgid "CPU"
msgstr "CPU"
-msgid "Network I/O"
-msgstr "Rede E/S"
-
msgid "Disk I/O"
msgstr "Disco E/S"
+msgid "Network I/O"
+msgstr "Rede E/S"
+
msgid "Livetile"
msgstr "Tela ao vivo"
@@ -756,6 +758,10 @@ msgid ""
msgstr ""
#, python-format
+msgid "Unable to start virtual machine %(name)s. Details: %(err)s"
+msgstr ""
+
+#, python-format
msgid "Interface %(iface)s does not exist in virtual machine %(name)s"
msgstr ""
@@ -951,6 +957,18 @@ msgstr ""
msgid "The SCSI host adapter name must be a string."
msgstr ""
+msgid "The storage pool kimchi_isos is reserved for internal use"
+msgstr ""
+
+#, python-format
+msgid ""
+"Unable to deactivate pool %(name)s as it is associated with some templates"
+msgstr ""
+
+#, python-format
+msgid "Unable to delete pool %(name)s as it is associated with some templates"
+msgstr ""
+
#, python-format
msgid "Storage volume %(name)s already exists"
msgstr ""
@@ -1096,6 +1114,13 @@ msgstr ""
msgid "Unable to generate debug report %(name)s. Details: %(err)s"
msgstr ""
+msgid "You should give a name for the debug file report."
+msgstr ""
+
+msgid ""
+"Name should be a string. Only letters, digits and hyphen ('-') are allowed."
+msgstr ""
+
#, python-format
msgid "Storage server %(server)s was not used by Kimchi"
msgstr ""
@@ -1154,16 +1179,13 @@ msgid "Invalid storage type. Types supported: 'cdrom'"
msgstr ""
#, python-format
-msgid "The path %(value)s is not valid local/remote path for the device"
+msgid "The path '%(value)s' is not valid local/remote path for the device"
msgstr ""
#, python-format
msgid "Device name %(dev_name)s already exists in vm %(vm_name)s"
msgstr ""
-msgid "Must specify a device name"
-msgstr ""
-
msgid "Can't specify a directory for a CDROM device path"
msgstr ""
@@ -1186,6 +1208,12 @@ msgstr ""
msgid "Do not support guest CDROM hot plug attachment"
msgstr ""
+msgid "Specify type and path to add a new virtual machine disk"
+msgstr ""
+
+msgid "Specify path to update virtual machine disk"
+msgstr ""
+
msgid "Repository ID must be one word only string."
msgstr ""
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 546ccef..0439b04 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-02-20 15:26-0300\n"
+"POT-Creation-Date: 2014-02-25 15:23-0300\n"
"PO-Revision-Date: 2013-06-27 10:48+0000\n"
"Last-Translator: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>\n"
"Language-Team: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>\n"
@@ -101,18 +101,21 @@ msgstr "取消"
msgid "Save"
msgstr "保存"
-msgid "Reset"
-msgstr "重置"
-
msgid "Start"
msgstr "启用"
+msgid "Reset"
+msgstr "重置"
+
msgid "Stop"
msgstr "停止"
msgid "Actions"
msgstr "操作"
+msgid "Console"
+msgstr ""
+
msgid "Edit"
msgstr "编辑"
@@ -249,6 +252,9 @@ msgstr "删除"
msgid "Download"
msgstr "下载"
+msgid "Report name should contain only letters, digits and/or hyphen ('-')."
+msgstr ""
+
msgid ""
"This will delete the virtual machine and its virtual disks. This operation "
"cannot be undone. Would you like to continue?"
@@ -307,12 +313,12 @@ msgstr "服务器不能为空"
msgid "This is not a valid Server Name or IP. please, modify it."
msgstr "这不是一个有效的服务器名或IP,请修改"
-msgid "Log out"
-msgstr "登出"
-
msgid "Help"
msgstr ""
+msgid "Log out"
+msgstr "登出"
+
msgid "Log In"
msgstr "登录"
@@ -330,11 +336,8 @@ msgstr "诊断报告名"
msgid ""
"The name used to identify the report. If omitted, a name will be chosen "
-"based on current time. Name can contain: letters, digits, \"-\", \"_\", or "
-"\".\"."
+"based on current time. Name can contain: letters, digits and hyphen (\"-\")."
msgstr ""
-"该名称用来唯一标识报告,如果不指定,将会基于当前时间自动生成一个名称。名称可"
-"以包含: 字母、数字、\"-\"、\"_\" 或者 \".\""
msgid "Define a New Storage Pool"
msgstr "定义一个新的存储池"
@@ -403,12 +406,12 @@ msgstr "iSCSI认证"
msgid "CPU"
msgstr "处理器"
-msgid "Network I/O"
-msgstr "网络I/O"
-
msgid "Disk I/O"
msgstr "磁盘I/O"
+msgid "Network I/O"
+msgstr "网络I/O"
+
msgid "Livetile"
msgstr "屏幕"
@@ -744,6 +747,10 @@ msgid ""
msgstr ""
#, python-format
+msgid "Unable to start virtual machine %(name)s. Details: %(err)s"
+msgstr ""
+
+#, python-format
msgid "Interface %(iface)s does not exist in virtual machine %(name)s"
msgstr ""
@@ -939,6 +946,18 @@ msgstr ""
msgid "The SCSI host adapter name must be a string."
msgstr ""
+msgid "The storage pool kimchi_isos is reserved for internal use"
+msgstr ""
+
+#, python-format
+msgid ""
+"Unable to deactivate pool %(name)s as it is associated with some templates"
+msgstr ""
+
+#, python-format
+msgid "Unable to delete pool %(name)s as it is associated with some templates"
+msgstr ""
+
#, python-format
msgid "Storage volume %(name)s already exists"
msgstr ""
@@ -1084,6 +1103,13 @@ msgstr ""
msgid "Unable to generate debug report %(name)s. Details: %(err)s"
msgstr ""
+msgid "You should give a name for the debug file report."
+msgstr ""
+
+msgid ""
+"Name should be a string. Only letters, digits and hyphen ('-') are allowed."
+msgstr ""
+
#, python-format
msgid "Storage server %(server)s was not used by Kimchi"
msgstr ""
@@ -1142,16 +1168,13 @@ msgid "Invalid storage type. Types supported: 'cdrom'"
msgstr ""
#, python-format
-msgid "The path %(value)s is not valid local/remote path for the device"
+msgid "The path '%(value)s' is not valid local/remote path for the device"
msgstr ""
#, python-format
msgid "Device name %(dev_name)s already exists in vm %(vm_name)s"
msgstr ""
-msgid "Must specify a device name"
-msgstr ""
-
msgid "Can't specify a directory for a CDROM device path"
msgstr ""
@@ -1174,6 +1197,12 @@ msgstr ""
msgid "Do not support guest CDROM hot plug attachment"
msgstr ""
+msgid "Specify type and path to add a new virtual machine disk"
+msgstr ""
+
+msgid "Specify path to update virtual machine disk"
+msgstr ""
+
msgid "Repository ID must be one word only string."
msgstr ""
diff --git a/src/kimchi/i18n.py b/src/kimchi/i18n.py
index fea0184..f766383 100644
--- a/src/kimchi/i18n.py
+++ b/src/kimchi/i18n.py
@@ -135,6 +135,8 @@ messages = {
"KCHPOOL0029E": _("The parameter disks only can be updated for logical storage pool."),
"KCHPOOL0030E": _("The SCSI host adapter name must be a string."),
"KCHPOOL0031E": _("The storage pool kimchi_isos is reserved for internal use"),
+ "KCHPOOL0032E": _("Unable to deactivate pool %(name)s as it is associated with some templates"),
+ "KCHPOOL0033E": _("Unable to delete pool %(name)s as it is associated with some templates"),
"KCHVOL0001E": _("Storage volume %(name)s already exists"),
"KCHVOL0002E": _("Storage volume %(name)s does not exist in storage pool %(pool)s"),
diff --git a/src/kimchi/model/storagepools.py b/src/kimchi/model/storagepools.py
index 011feb0..d4a6ee8 100644
--- a/src/kimchi/model/storagepools.py
+++ b/src/kimchi/model/storagepools.py
@@ -29,8 +29,7 @@ from kimchi.exception import NotFoundError, OperationFailed
from kimchi.model.config import CapabilitiesModel
from kimchi.model.host import DeviceModel
from kimchi.model.libvirtstoragepool import StoragePoolDef
-from kimchi.utils import add_task, kimchi_log
-from kimchi.utils import run_command
+from kimchi.utils import add_task, kimchi_log, pool_name_from_uri, run_command
ISO_POOL_NAME = u'kimchi_isos'
@@ -190,7 +189,7 @@ class StoragePoolModel(object):
elif len(res) == 0:
source[key] = ""
else:
- souce[key] = res
+ source[key] = res
return source
@@ -273,7 +272,20 @@ class StoragePoolModel(object):
raise OperationFailed("KCHPOOL0009E",
{'name': name, 'err': e.get_error_message()})
+ def _pool_used_by_template(self, pool_name):
+ with self.objstore as session:
+ templates = session.get_list('template')
+ for tmpl in templates:
+ t_info = session.get('template', tmpl)
+ t_pool = pool_name_from_uri(t_info['storagepool'])
+ if t_pool == pool_name:
+ return True
+ return False
+
def deactivate(self, name):
+ if self._pool_used_by_template(name):
+ raise InvalidOperation('KCHPOOL0032E', {'name': name})
+
pool = self.get_storagepool(name, self.conn)
try:
pool.destroy()
@@ -282,6 +294,9 @@ class StoragePoolModel(object):
{'name': name, 'err': e.get_error_message()})
def delete(self, name):
+ if self._pool_used_by_template(name):
+ raise InvalidOperation('KCHPOOL0033E', {'name': name})
+
pool = self.get_storagepool(name, self.conn)
if pool.isActive():
raise InvalidOperation("KCHPOOL0005E", {'name': name})
diff --git a/tests/test_model.py b/tests/test_model.py
index 74e2424..7cf2f08 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -406,6 +406,11 @@ class ModelTests(unittest.TestCase):
disk_path = '/tmp/kimchi-images/%s-0.img' % vm_info['uuid']
self.assertTrue(os.access(disk_path, os.F_OK))
+ # reset template to default storage pool
+ # so we can remove the storage pool created 'test-pool'
+ params = {'storagepool': '/storagepools/default'}
+ inst.template_update('test', params)
+
@unittest.skipUnless(utils.running_as_root(), 'Must be run as root')
def test_template_create(self):
inst = model.Model('test:///default',
--
1.7.10.4
10 years, 10 months
[PATCH 0/4] Issue 294: The auto logout leaves action menu on page
by Adam King
The defect reported that the kimchi UI overlays the login form over
whatever is being displayed when the session becomes invalid.
The defect describes how open menus are left above part of the login overlay
in the zOrder, leaving an undesirable visual mashup.
Additionally, information about the userID and the defined
VMs remained visible (if grayed), representing a potential security exposure.
This patch series removes any information from the UI that could be deemed
sensitive whenever the session times out, defines a message to be displayed
when the host can't be reached, and corrects the error flow to propagate all
available information to the final error handler.
Adam King (4):
Create new error message to be displayed when we get an unexpeted ajax
error
Fix formatting of the requestJSON function
Pass ajaxError information on to original requester on ajaxError event
Issue 294 The auto logout leaves action menu on page
po/en_US.po | 19 ++++++++++++++++++-
po/kimchi.pot | 19 ++++++++++++++++++-
po/pt_BR.po | 23 ++++++++++++++++++++++-
po/zh_CN.po | 19 ++++++++++++++++++-
ui/js/src/kimchi.api.js | 2 +-
ui/js/src/kimchi.guest_main.js | 9 +++++++--
ui/js/src/kimchi.main.js | 6 +++++-
ui/pages/i18n.html.tmpl | 1 +
ui/pages/kimchi-ui.html.tmpl | 2 +-
ui/pages/tabs/guests.html.tmpl | 2 +-
10 files changed, 92 insertions(+), 10 deletions(-)
--
1.8.1.4
10 years, 10 months
[PATCH V1] Can not create a VM from a template with disks['volume'] parameters. #181
by Shu Ming
The latest code have removed disks["volume"] from API.json, but API.md
was not updated accordingly. The in-consistence between API.json and
API.md should be corrected first. Then, the invalid code in
VMTemplate.validate_integrity() should also be cleaned.
---
docs/API.md | 1 -
src/kimchi/vmtemplate.py | 9 ---------
tests/test_model.py | 4 +---
tests/test_rest.py | 4 +---
4 files changed, 2 insertions(+), 16 deletions(-)
diff --git a/docs/API.md b/docs/API.md
index e97eace..fc39c65 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -161,7 +161,6 @@ Represents a snapshot of the Virtual Machine's primary monitor.
(either *size* or *volume* must be specified):
* index: The device index
* size: The device size in GB
- * volume: A volume name that contains the initial disk contents
* graphics *(optional)*: The graphics paramenters of this template
* type: The type of graphics. It can be VNC or spice or None.
diff --git a/src/kimchi/vmtemplate.py b/src/kimchi/vmtemplate.py
index f786fa5..3e52be5 100644
--- a/src/kimchi/vmtemplate.py
+++ b/src/kimchi/vmtemplate.py
@@ -361,15 +361,6 @@ class VMTemplate(object):
except Exception:
invalid['cdrom'] = [iso]
- # validate disks integrity
- volumes = []
- for disk in self.info['disks']:
- volume = disk.get("volume")
- if volume is not None and not os.path.exists(volume):
- volumes.append(volume)
- if volumes:
- invalid['disks'] = volumes
-
self.info['invalid'] = invalid
return self.info
diff --git a/tests/test_model.py b/tests/test_model.py
index 8bb1ccc..a08b3d9 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -468,8 +468,7 @@ class ModelTests(unittest.TestCase):
iso_gen.construct_fake_iso(iso, True, '12.04', 'ubuntu')
params = {'name': 'test', 'memory': 1024, 'cpus': 1,
- 'networks': ['test-network'], 'cdrom': iso,
- 'disks': [{'volume': iso}]}
+ 'networks': ['test-network'], 'cdrom': iso}
inst.templates_create(params)
rollback.prependDefer(inst.template_delete, 'test')
@@ -479,7 +478,6 @@ class ModelTests(unittest.TestCase):
info = inst.template_lookup('test')
self.assertEquals(info['invalid']['cdrom'], [iso])
self.assertEquals(info['invalid']['networks'], [net_name])
- self.assertEquals(info['invalid']['disks'], [iso])
@unittest.skipUnless(utils.running_as_root(), 'Must be run as root')
def test_template_clone(self):
diff --git a/tests/test_rest.py b/tests/test_rest.py
index d59882b..54530f3 100644
--- a/tests/test_rest.py
+++ b/tests/test_rest.py
@@ -1088,8 +1088,7 @@ class RestTests(unittest.TestCase):
self.assertEquals(201, resp.status)
t = {'name': 'test', 'memory': 1024, 'cpus': 1,
- 'networks': ['test-network'], 'cdrom': iso,
- 'disks': [{'volume': iso}]}
+ 'networks': ['test-network'], 'cdrom': iso}
req = json.dumps(t)
resp = self.request('/templates', req, 'POST')
@@ -1104,7 +1103,6 @@ class RestTests(unittest.TestCase):
res = json.loads(self.request('/templates/test').read())
self.assertEquals(res['invalid']['cdrom'], [iso])
self.assertEquals(res['invalid']['networks'], ['test-network'])
- self.assertEquals(res['invalid']['disks'], [iso])
# Delete the template
resp = request(host, port, '/templates/test', '{}', 'DELETE')
--
1.8.1.4
10 years, 10 months