[PATCH] i18n support: Add new languages in login page.
by Paulo Vital
Adding the 'Deutsch (Deutschland)' German, 'Español (España)'
Spanish, 'Français (France)' French, 'Italiano (Italia)' Italian,
'日本語 (日本)' Japanese, '한국어 (대한민국)' Korean,
'Русский (Россия)' Russian and '中文(繁體)' Traditional Chinese
languages as options in the login page to be selected before use
Kimchi.
Signed-off-by: Paulo Vital <pvital(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.lang.js | 10 +++++++++-
ui/pages/login.html.tmpl | 8 ++++++++
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/ui/js/src/kimchi.lang.js b/ui/js/src/kimchi.lang.js
index da55307..1d2de4e 100644
--- a/ui/js/src/kimchi.lang.js
+++ b/ui/js/src/kimchi.lang.js
@@ -20,7 +20,15 @@ kimchi.lang = {
return {
'en_US': 'English (US)',
'zh_CN': '中文(简体)',
- 'pt_BR': 'Português (Brasil)'
+ 'pt_BR': 'Português (Brasil)',
+ 'de_DE': 'Deutsch (Deutschland)',
+ 'es_ES': 'Español (España)',
+ 'fr_FR': 'Français (France)',
+ 'it_IT': 'Italiano (Italia)',
+ 'ja_JP': '日本語 (日本)',
+ 'ko_KR': '한국어 (대한민국)',
+ 'ru_RU': 'Русский (Россия)',
+ 'zh_TW': '中文(繁體)'
};
},
diff --git a/ui/pages/login.html.tmpl b/ui/pages/login.html.tmpl
index 7d61a6a..d4d5b7e 100644
--- a/ui/pages/login.html.tmpl
+++ b/ui/pages/login.html.tmpl
@@ -65,6 +65,14 @@
<option value="en_US">English (US)</option>
<option value="zh_CN">中文(简体)</option>
<option value="pt_BR">Português (Brasil)</option>
+ <option value="de_DE">Deutsch (Deutschland)</option>
+ <option value="es_ES">Español (España)</option>
+ <option value="fr_FR">Français (France)</option>
+ <option value="it_IT">Italiano (Italia)</option>
+ <option value="ja_JP">日本語 (日本)</option>
+ <option value="ko_KR">한국어 (대한민국)</option>
+ <option value="ru_RU">Русский (Россия)</option>
+ <option value="zh_TW">中文(繁體)</option>
</select>
</div>
<div id="login-window" class="login-area">
--
1.9.3
10 years, 4 months
[PATCH 0/2 V2] Centralize graphics information
by Aline Manera
V1 -> V2:
- Allow user updates the passwd expiration time without changing the passwd
Aline Manera (2):
Centralize graphics information
Allow user updates the passwd expiration time without changing the
passwd
docs/API.md | 14 +++---
src/kimchi/API.json | 12 ++---
src/kimchi/control/vms.py | 2 +-
src/kimchi/i18n.py | 4 +-
src/kimchi/mockmodel.py | 38 ++++++++------
src/kimchi/model/vms.py | 124 ++++++++++++++++++++--------------------------
tests/test_mockmodel.py | 2 +-
tests/test_model.py | 19 +++----
tests/test_rest.py | 13 ++---
9 files changed, 112 insertions(+), 116 deletions(-)
--
1.9.3
10 years, 4 months
[PATCH] Update iSCSI volume XML when creating a VM from an iSCSI pool
by Aline Manera
When creating a VM using a iSCSI volume, the volume XML was like below:
<disk type='volume' device='disk'>
<driver name='qemu' type='raw'/>
<source pool='TEST-ISCSI1' volume='unit:0:0:2' mode='host'/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</disk>
But to attach a new iSCSI volume, the XML is:
<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/disk/by-id/wwn-0x60000000000000000e00000000010001'/>
<target dev='vdb' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</disk>
We should keep the same XML structure in both cases to avoid problems
while listing the storage volumes and getting their information.
To solve that, this patch uses the latter XML also while creating a VM
from a iSCSI volume.
It eliminates the needs to have the authentication setting in the
volume, because that the _get_storage_auth() function was replaced by
_get_volume_path()
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
src/kimchi/mockmodel.py | 3 +++
src/kimchi/model/templates.py | 15 ++++++---------
src/kimchi/model/vms.py | 6 +-----
src/kimchi/vmtemplate.py | 16 +++++-----------
4 files changed, 15 insertions(+), 25 deletions(-)
diff --git a/src/kimchi/mockmodel.py b/src/kimchi/mockmodel.py
index fc474de..1bd54cc 100644
--- a/src/kimchi/mockmodel.py
+++ b/src/kimchi/mockmodel.py
@@ -997,6 +997,9 @@ class MockVMTemplate(VMTemplate):
pool = self._storage_validate()
return pool.info['path']
+ def _get_volume_path(self, pool, vol):
+ return self.model.storagevolume_lookup(pool, vol)['path']
+
def fork_vm_storage(self, vm_name):
pool = self._storage_validate()
volumes = self.to_volume_list(vm_name)
diff --git a/src/kimchi/model/templates.py b/src/kimchi/model/templates.py
index bf04304..9278cdc 100644
--- a/src/kimchi/model/templates.py
+++ b/src/kimchi/model/templates.py
@@ -29,7 +29,6 @@ from kimchi.kvmusertests import UserTests
from kimchi.utils import pool_name_from_uri
from kimchi.utils import probe_file_permission_as_user
from kimchi.vmtemplate import VMTemplate
-from lxml import objectify
class TemplatesModel(object):
@@ -243,15 +242,13 @@ class LibvirtVMTemplate(VMTemplate):
xml = pool.XMLDesc(0)
return xmlutils.xpath_get_text(xml, "/pool/@type")[0]
- def _get_storage_auth(self):
+ def _get_volume_path(self, pool, vol):
pool = self._storage_validate()
- xml = pool.XMLDesc(0)
- root = objectify.fromstring(xml)
- auth = root.source.find("auth")
- if auth is None:
- return auth
- au = auth.attrib
- return au.update(auth.secret.attrib)
+ try:
+ return pool.storageVolLookupByName(vol).path()
+ except:
+ raise NotFoundError("KCHVOL0002E", {'name': vol,
+ 'pool': pool})
def fork_vm_storage(self, vm_uuid):
# Provision storage:
diff --git a/src/kimchi/model/vms.py b/src/kimchi/model/vms.py
index 5721b48..4787840 100644
--- a/src/kimchi/model/vms.py
+++ b/src/kimchi/model/vms.py
@@ -203,11 +203,7 @@ class VMsModel(object):
# If storagepool is SCSI, volumes will be LUNs and must be passed by
# the user from UI or manually.
vol_list = []
- if t._get_storage_type() in ["iscsi", "scsi"]:
- # FIXME: iscsi and scsi storage work with base image needs to be
- # fixed.
- vol_list = []
- else:
+ if t._get_storage_type() not in ["iscsi", "scsi"]:
vol_list = t.fork_vm_storage(vm_uuid)
graphics = params.get('graphics')
diff --git a/src/kimchi/vmtemplate.py b/src/kimchi/vmtemplate.py
index ddb1f35..c5bb7b3 100644
--- a/src/kimchi/vmtemplate.py
+++ b/src/kimchi/vmtemplate.py
@@ -251,25 +251,19 @@ drive=drive-%(bus)s0-1-0,id=%(bus)s0-1-0'/>
def _get_iscsi_disks_xml(self):
def build_disk_xml(children=[]):
- disk = E.disk(type='volume', device='disk')
+ disk = E.disk(type='block', device='disk')
disk.extend(children)
return etree.tostring(disk)
ret = ""
children = []
- auth = self._get_storage_auth()
- if auth:
- etree_auth = E.auth(username=auth['username'])
- etree_auth.append(E.secret(type=auth['type'],
- usage=auth['libvirtiscsi']))
- children.append(etree_auth)
children.append(E.driver(name='qemu', type='raw'))
disk_bus = self.info['disk_bus']
dev_prefix = self._bus_to_dev[disk_bus]
pool_name = pool_name_from_uri(self.info['storagepool'])
for i, d in enumerate(self.info['disks']):
- source = E.source(pool=pool_name,
- volume=d.get('volume'), mode='host')
+ source = E.source(dev=self._get_volume_path(pool_name,
+ d.get('volume')))
# FIXME if more than 26 disks
target = E.target(dev=dev_prefix + string.lowercase[i],
bus=disk_bus)
@@ -455,8 +449,8 @@ drive=drive-%(bus)s0-1-0,id=%(bus)s0-1-0'/>
def _get_storage_type(self):
return ''
- def _get_storage_auth(self):
- return None
+ def _get_volume_path(self):
+ return ''
def _get_all_networks_name(self):
return []
--
1.9.3
10 years, 4 months
[PATCH V2 0/9] i18n support: Addition of new languages.
by Paulo Vital
V1 -> V2:
* fixed wrong python variables in translated strings
* removed string without msgid
V1:
This patch set adds new languages to improve Kimchi's i18n support. The
new languages are: German (de_DE), Spanish (es_ES), Franch (fr_FR),
Italian (it_IT), Japanese (ja_JP), Korean (ko_KR), Russian (ru_RU) and
the Traditional Chinese (zh_TW).
Also, the patch set removed the symbolic link of plugins/sample/po/LINGUAS
to be a 'real' file containing only the three first languages in the
sample plugin.
Paulo Vital (9):
i18n support: Changed the file type of plugins/sample/po/LINGUAS
i18n support: Add German translation files.
i18n support: Add Spanish translation files.
i18n support: Add French translation files.
i18n support: Add Italian translation files.
i18n support: Add Japanese translation files.
18n support: Add Korean translation files.
i18n support: Add Russian translation files.
i18n support: Add Traditional Chinese translation files.
plugins/sample/po/LINGUAS | 4 +-
po/LINGUAS | 8 +
po/de_DE.po | 2256 ++++++++++++++++++++++++++++++++++++++++++++
po/es_ES.po | 2281 ++++++++++++++++++++++++++++++++++++++++++++
po/fr_FR.po | 2285 +++++++++++++++++++++++++++++++++++++++++++++
po/it_IT.po | 2248 ++++++++++++++++++++++++++++++++++++++++++++
po/ja_JP.po | 2227 +++++++++++++++++++++++++++++++++++++++++++
po/ko_KR.po | 2137 ++++++++++++++++++++++++++++++++++++++++++
po/ru_RU.po | 2138 ++++++++++++++++++++++++++++++++++++++++++
po/zh_TW.po | 2054 ++++++++++++++++++++++++++++++++++++++++
10 files changed, 17637 insertions(+), 1 deletion(-)
mode change 120000 => 100644 plugins/sample/po/LINGUAS
create mode 100644 po/de_DE.po
create mode 100644 po/es_ES.po
create mode 100644 po/fr_FR.po
create mode 100644 po/it_IT.po
create mode 100644 po/ja_JP.po
create mode 100644 po/ko_KR.po
create mode 100644 po/ru_RU.po
create mode 100644 po/zh_TW.po
--
1.9.3
10 years, 4 months
[PATCH] Fix duplicated message string in en_US.po file.
by Paulo Vital
The en_US.po file has the same message string to two different message
ID's. The two message ID's are used in different situations and linked
to different messages codes in i18n.pu file. Changed to use the same
content of msgid in msgstr.
Signed-off-by: Paulo Vital <pvital(a)linux.vnet.ibm.com>
---
po/en_US.po | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/po/en_US.po b/po/en_US.po
index ef4b127..1cef680 100644
--- a/po/en_US.po
+++ b/po/en_US.po
@@ -856,8 +856,8 @@ msgid ""
"Only one of path or pool/volume can be specified to add a new virtual "
"machine disk"
msgstr ""
-"Specify type and path or type and pool/volume to add a new virtual machine "
-"disk"
+"Only one of path or pool/volume can be specified to add a new virtual "
+"machine disk"
msgid "YUM Repository ID must be one word only string."
msgstr "YUM Repository ID must be one word only string."
--
1.9.3
10 years, 4 months
[V2] UI: List iSCSI Servers & Targets
by huoyuxin@linux.vnet.ibm.com
From: Yu Xin Huo <huoyuxin(a)linux.vnet.ibm.com>
Signed-off-by: Yu Xin Huo <huoyuxin(a)linux.vnet.ibm.com>
---
ui/css/theme-default/storage.css | 69 +++++++++++++++++++++-
ui/js/src/kimchi.api.js | 30 ++++++++++
ui/js/src/kimchi.storagepool_add_main.js | 94 ++++++++++++++++++++++++++++++
ui/pages/storagepool-add.html.tmpl | 12 +++-
4 files changed, 201 insertions(+), 4 deletions(-)
diff --git a/ui/css/theme-default/storage.css b/ui/css/theme-default/storage.css
index 4f439e8..1b71d82 100644
--- a/ui/css/theme-default/storage.css
+++ b/ui/css/theme-default/storage.css
@@ -315,7 +315,7 @@
}
.hide-content {
- display: none;
+ display: none!important;
}
.volumeslist {
@@ -593,3 +593,70 @@
center no-repeat;
padding: 0 20px 0 26px;
}
+
+.storage-admin .filter-select {
+ display: inline-block;
+ position: relative;
+}
+
+#iscsiportId, .storage-admin .filter-select input {
+ border: 1px solid #CCCCCC;
+ border-radius: 1px;
+ font-size: 14px;
+ padding: 3px 3px 3px 10px;
+ height: 30px;
+}
+
+.storage-admin .filter-select input::-ms-clear {
+ display: none;
+}
+
+.storage-admin .filter-select .arrow {
+ display: inline-block;
+ vertical-align: middle;
+ position: relative;
+ left: -25px;
+}
+
+.storage-admin .filter-select .option {
+ border-style: solid;
+ border-color: #CCCCCC;
+ border-width: 0px 1px 1px 1px;
+ border-radius: 1px;
+ font-size: 14px;
+ background-color: white;
+ max-height: 140px;
+ overflow: auto;
+ color: #666666;
+ position: absolute;
+ z-index: 1000;
+}
+
+.storage-admin .filter-select .option .item {
+ padding: 5px 10px;
+ cursor: pointer;
+}
+
+.storage-admin .filter-select .option .item:hover {
+ background-color: #DDDDDD;
+}
+
+#iSCSIServer input {
+ width: 410px;
+}
+
+#iSCSIServer .option {
+ width: 423px;
+}
+
+#iscsiportId {
+ width: 60px;
+}
+
+#iSCSITarget input {
+ width: 493px;
+}
+
+#iSCSITarget .option {
+ width: 506px;
+}
diff --git a/ui/js/src/kimchi.api.js b/ui/js/src/kimchi.api.js
index 4562992..9de1b08 100644
--- a/ui/js/src/kimchi.api.js
+++ b/ui/js/src/kimchi.api.js
@@ -1098,5 +1098,35 @@ var kimchi = {
kimchi.message.error(data.responseJSON.reason);
}
});
+ },
+
+ getISCSIServers : function(suc, err) {
+ kimchi.requestJSON({
+ url : kimchi.url + 'storageservers?_target_type=iscsi',
+ type : 'GET',
+ contentType : 'application/json',
+ dataType : 'json',
+ resend : true,
+ success : suc,
+ error : err ? err : function(data) {
+ kimchi.message.error(data.responseJSON.reason);
+ }
+ });
+ },
+
+ getISCSITargets : function(server, port, suc, err) {
+ server = encodeURIComponent(server);
+ port = encodeURIComponent(port);
+ kimchi.requestJSON({
+ url : kimchi.url + 'storageservers/'+server+'/storagetargets?_target_type=iscsi&_server_port='+port,
+ type : 'GET',
+ contentType : 'application/json',
+ dataType : 'json',
+ resend : true,
+ success : suc,
+ error : err ? err : function(data) {
+ kimchi.message.error(data.responseJSON.reason);
+ }
+ });
}
};
diff --git a/ui/js/src/kimchi.storagepool_add_main.js b/ui/js/src/kimchi.storagepool_add_main.js
index ecbc682..affb714 100644
--- a/ui/js/src/kimchi.storagepool_add_main.js
+++ b/ui/js/src/kimchi.storagepool_add_main.js
@@ -34,6 +34,96 @@ kimchi.storagepool_add_main = function() {
});
};
+kimchi.storageFilterSelect = function(id, isUpdate) {
+ var input = $('input', '#'+id);
+ var options = $(".option", '#'+id);
+ $('.arrow', '#'+id).toggleClass("hide-content", options.children().length==0);
+ var filter = function(container, key){
+ container.children().each(function(){
+ $(this).css("display", $(this).text().indexOf(key)==-1 ? "none" : "");
+ });
+ };
+ if(!isUpdate){
+ $('.arrow', '#'+id).click(function(){
+ options.toggleClass("hide-content");
+ });
+ input.focus(function(){
+ options.removeClass("hide-content");
+ }).on("keyup", function(){
+ filter(options, input.val());
+ });
+ }
+ options.children().each(function(){
+ $(this).click(function(){
+ input.val($(this).text());
+ $('.option', '#'+id).addClass("hide-content");
+ filter(options, "");
+ });
+ });
+};
+
+kimchi.setupISCSI = function(){
+ var loadTargets = function(server, port, callback){
+ var isUpdate = $(".option", "#iSCSITarget").children().length > 0;
+ $(".option", "#iSCSITarget").empty();
+ $('input', "#iSCSITarget").attr("placeholder", "loading targets...");
+ kimchi.getISCSITargets(server, port, function(data){
+ if(data.length==0){
+ $('input', "#iSCSITarget").attr("placeholder", "no targets is got, please input one.");
+ }else{
+ for(var i=0; i<data.length; i++){
+ var itemNode = $.parseHTML("<div class='item'>"+data[i].target+"</div>");
+ $(".option", "#iSCSITarget").append(itemNode);
+ }
+ $('input', "#iSCSITarget").attr("placeholder", "");
+ }
+ kimchi.storageFilterSelect('iSCSITarget', isUpdate);
+ $('input', "#iSCSITarget").trigger("focus");
+ callback();
+ }, function(data){
+ $('input', "#iSCSITarget").attr("placeholder","failed to load targets.");
+ callback();
+ kimchi.message.error(data.responseJSON.reason);
+ });
+ };
+ var triggerLoadTarget = function(){
+ $('input', "#iSCSITarget").val("");
+ var server = $("#iscsiserverId").val().trim();
+ var port = $("#iscsiportId").val().trim();
+ if(server!="" && port!="" && !$("#iscsiserverId").hasClass("invalid-field") && !$("#iscsiportId").hasClass("invalid-field")){
+ $("#iscsiserverId").attr("disabled", true);
+ $("#iscsiportId").attr("disabled", true);
+ $('.arrow', '#iSCSIServer').addClass("hide-content");
+ loadTargets(server, port, function(){
+ $("#iscsiserverId").attr("disabled", false);
+ $("#iscsiportId").attr("disabled", false);
+ $('.arrow', '#iSCSIServer').removeClass("hide-content");
+ });
+ }
+ };
+ $("#iscsiserverId").change(function(){
+ triggerLoadTarget();
+ });
+ $("#iscsiportId").change(function(){
+ triggerLoadTarget();
+ });
+ var initISCSIServers = function(){
+ kimchi.getISCSIServers(function(data){
+ for(var i=0;i<data.length;i++){
+ var itemNode = $.parseHTML("<div class='item'>"+data[i].host+"</div>");
+ $(".option", "#iSCSIServer").append(itemNode);
+ $(itemNode).click(function(){
+ $("#iscsiportId").val($(this).prop("port"));
+ $("#iscsiserverId").val($(this).text());
+ triggerLoadTarget();
+ }).prop("port", data[i].port);
+ }
+ kimchi.storageFilterSelect('iSCSIServer', false);
+ });
+ };
+ initISCSIServers();
+};
+
kimchi.initStorageAddPage = function() {
kimchi.listHostPartitions(function(data) {
if (data.length > 0) {
@@ -160,6 +250,10 @@ kimchi.initStorageAddPage = function() {
$('#iscsiportId').keyup(function(event) {
$(this).toggleClass("invalid-field",!/^[0-9]+$/.test($(this).val()));
});
+ $('#iscsiserverId').keyup(function(event) {
+ $(this).toggleClass("invalid-field",!kimchi.isServer($(this).val().trim()));
+ });
+ kimchi.setupISCSI();
};
/* Returns 'true' if all form fields were filled, 'false' if
diff --git a/ui/pages/storagepool-add.html.tmpl b/ui/pages/storagepool-add.html.tmpl
index 1eb2029..6b526a7 100644
--- a/ui/pages/storagepool-add.html.tmpl
+++ b/ui/pages/storagepool-add.html.tmpl
@@ -23,7 +23,7 @@
<!DOCTYPE html>
<html>
<body>
- <div class="window storage-window">
+ <div class="window storage-window storage-admin">
<header>
<h1 class="title">$_("Define a New Storage Pool")</h1>
<div class="close">X</div>
@@ -111,7 +111,10 @@
<div class="field">
<p class="text-help">
$_("iSCSI server IP or hostname. It should not be empty.")</p>
- <input id="iscsiserverId" placeholder="$_("Server")" type="text" class="text storage-base-input-width">
+ <span class="filter-select" id="iSCSIServer">
+ <div><input id="iscsiserverId" type="text" placeholder="$_("Server")"><a class="ui-icon ui-icon-triangle-1-s arrow hide-content"></a></div>
+ <div class="option hide-content"></div>
+ </span>
<input id="iscsiportId" placeholder="$_("Port")" type="text" class="text storage-port-width" maxlength="4">
</div>
</section>
@@ -119,7 +122,10 @@
<h2>4. $_("Target")</h2>
<div class="field">
<p class="text-help">$_("The iSCSI target on iSCSI server")</p>
- <input id="iscsiTargetId" type="text" class="text storage-base-input-width">
+ <span class="filter-select" id="iSCSITarget">
+ <div><input id="iscsiTargetId" type="text"><a class="ui-icon ui-icon-triangle-1-s arrow hide-content"></a></div>
+ <div class="option hide-content"></div>
+ </span>
</div>
</section>
<section class="form-section">
--
1.7.1
10 years, 4 months
[PATCH V2 0/4] Power (ppc) support patches
by Paulo Vital
v1 -> v2:
* Re-wrote commit message for patch 2/5 (now 2/4) with 80 characters/line
* Joined patches 3/5 and 4/5 in only one (now 3/4) about sosreport support
V1:
This patch set enables Power(ppc) support by default on Kimchi.
Whithout them, the upstream code of Kimchi is not fully compatible
with the Power architecture.
Eli Qiao (1):
Support tablet type as input device in VM's XML.
Mark Wu (1):
Add sos plugin for kimchi
Paulo Vital (2):
PowerKVM: Workaround of numpy byte order bug on PowerPC
Add PowerKVM information as ISO otpion to installation.
contrib/kimchi.spec.fedora.in | 3 +++
src/kimchi/Makefile.am | 4 +++-
src/kimchi/isoinfo.py | 1 +
src/kimchi/osinfo.py | 5 +++--
src/kimchi/sos.py | 37 +++++++++++++++++++++++++++++++++++++
src/kimchi/vmtemplate.py | 5 +++++
src/kimchi/websocket.py | 7 +++++--
7 files changed, 57 insertions(+), 5 deletions(-)
create mode 100644 src/kimchi/sos.py
--
1.9.3
10 years, 4 months
[PATCH V3] Add sos plugin for kimchi
by Paulo Vital
From: Mark Wu <wudxw(a)linux.vnet.ibm.com>
This patches adds a sos plugin to collect kimchi's configuration,
log files and other information for diagnosis.
Signed-off-by: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Signed-off-by: Eli Qiao <taget(a)linux.vnet.ibm.com>
Signed-off-by: Paulo Vital <pvital(a)linux.vnet.ibm.com>
---
Makefile.am | 1 +
contrib/kimchi.spec.fedora.in | 3 +++
src/kimchi/Makefile.am | 4 +++-
src/kimchi/sos.py | 43 +++++++++++++++++++++++++++++++++++++++++++
4 files changed, 50 insertions(+), 1 deletion(-)
create mode 100644 src/kimchi/sos.py
diff --git a/Makefile.am b/Makefile.am
index 3293d9e..8776760 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -69,6 +69,7 @@ PEP8_WHITELIST = \
src/kimchi/root.py \
src/kimchi/scan.py \
src/kimchi/server.py \
+ src/kimchi/sos.py \
src/kimchi/swupdate.py \
src/kimchi/template.py \
src/kimchi/utils.py \
diff --git a/contrib/kimchi.spec.fedora.in b/contrib/kimchi.spec.fedora.in
index 5766784..78dd423 100644
--- a/contrib/kimchi.spec.fedora.in
+++ b/contrib/kimchi.spec.fedora.in
@@ -78,6 +78,8 @@ make
%install
rm -rf %{buildroot}
make DESTDIR=%{buildroot} install
+install -Dm 0644 src/kimchi/sos.py \
+ %{buildroot}/%{python_sitelib}/sos/plugins/kimchi.py
%if 0%{?with_systemd}
# Install the systemd scripts
@@ -158,6 +160,7 @@ rm -rf $RPM_BUILD_ROOT
%{python_sitelib}/kimchi/model/*.py*
%{python_sitelib}/kimchi/API.json
%{python_sitelib}/kimchi/plugins/*.py*
+%{python_sitelib}/sos/plugins/kimchi.py*
%{_datadir}/kimchi/doc/API.md
%{_datadir}/kimchi/doc/README.md
%{_datadir}/kimchi/doc/kimchi-guest.png
diff --git a/src/kimchi/Makefile.am b/src/kimchi/Makefile.am
index e2b5bea..a405782 100644
--- a/src/kimchi/Makefile.am
+++ b/src/kimchi/Makefile.am
@@ -19,10 +19,12 @@
SUBDIRS = control model
-kimchi_PYTHON = $(filter-out config.py, $(wildcard *.py))
+kimchi_PYTHON = $(filter-out config.py sos.py, $(wildcard *.py))
nodist_kimchi_PYTHON = config.py
+dist_noinst_PYTHON = sos.py
+
EXTRA_DIST = \
API.json \
config.py.in
diff --git a/src/kimchi/sos.py b/src/kimchi/sos.py
new file mode 100644
index 0000000..5d1fa3f
--- /dev/null
+++ b/src/kimchi/sos.py
@@ -0,0 +1,43 @@
+#
+# Project Kimchi
+#
+# Copyright IBM, Corp. 2014
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin
+from sos.utilities import sos_get_command_output
+
+
+class Kimchi(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin):
+ """
+ kimchi-related information
+ """
+
+ plugin_name = 'kimchi'
+
+ def setup(self):
+ self.add_copy_specs([
+ "/etc/kimchi/",
+ "/var/log/kimchi*"
+ ])
+ self.add_cmd_output("virsh pool-list --details")
+ rc, out, _ = sos_get_command_output('virsh pool-list')
+ if rc == 0:
+ for pool in out.splitlines()[2:]:
+ if pool:
+ pool_name = pool.split()[0]
+ self.add_cmd_output("virsh vol-list --pool %s --details"
+ % pool_name)
--
1.9.3
10 years, 4 months
[PATCH] Fix guest disk return when disk is a iscsi volume
by Rodrigo Trujillo
When a guest has an ISCSI volume attached as disk, backend is not
returning path correctly, it return a blank field. This patch fixes
this problem, returning the path = <iscsi pool> - <volume unit>.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
src/kimchi/vmdisks.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/kimchi/vmdisks.py b/src/kimchi/vmdisks.py
index 6012ada..6835172 100644
--- a/src/kimchi/vmdisks.py
+++ b/src/kimchi/vmdisks.py
@@ -53,6 +53,9 @@ def get_vm_disk(dom, dev_name):
path = (source.attrib['protocol'] + '://' +
host.attrib['name'] + ':' +
host.attrib['port'] + source.attrib['name'])
+ # ISCSI, Fibre Channel
+ elif src_type == 'volume':
+ path = source.attrib['pool'] + ' - ' + source.attrib['volume']
else:
path = source.attrib[DEV_TYPE_SRC_ATTR_MAP[src_type]]
# Retrieve storage bus type
--
1.9.3
10 years, 4 months
Kimchi on Transifex
by Aline Manera
Hi all,
I recently added Kimchi translation file to Transifex.
Transifex is a collaborative tool for translation. Its message is clear:
"100+ languages? Only a few developers? No problem."
I think that way we can support more and more languages in Kimchi once
people get involved.
https://www.transifex.com/organization/kimchi/dashboard
Please, join the Kimchi translation team on Transifex and share it
globally. :-D
Regards,
Aline Manera
10 years, 4 months