[PATCH] hack for create a vm from scsi/iscsi volume
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
after apply this patch.
you can find a usb scsi targe, and create a scsi pool on this usb
scsi target. and then create a VM on the lun of this pool.
This patch is just for scsi test.
Do not need to merge this patch.
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
src/kimchi/model/host.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/kimchi/model/host.py b/src/kimchi/model/host.py
index 7b151f2..feee1c3 100644
--- a/src/kimchi/model/host.py
+++ b/src/kimchi/model/host.py
@@ -244,6 +244,14 @@ class DevicesModel(object):
def _get_devices_fc_host(self):
conn = self.conn.get()
# Libvirt < 1.0.5 does not support fc_host capability
+ ret = []
+ scsi_hosts = conn.listDevices('scsi_host', 0)
+ for host in scsi_hosts:
+ xml = conn.nodeDeviceLookupByName(host).XMLDesc(0)
+ path = '/device/path'
+ if 'usb' in xmlutils.xpath_get_text(xml, path)[0]:
+ ret.append(host)
+ return ret
if not CapabilitiesModel().fc_host_support:
ret = []
scsi_hosts = conn.listDevices('scsi_host', 0)
--
1.8.5.3
10 years, 6 months
[WIP 1/2] UI: add list Host Devices API
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
This API is used to get the Devices of Host.
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.api.js | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/ui/js/src/kimchi.api.js b/ui/js/src/kimchi.api.js
index 4310435..d6d7c4b 100644
--- a/ui/js/src/kimchi.api.js
+++ b/ui/js/src/kimchi.api.js
@@ -706,6 +706,18 @@ var kimchi = {
});
},
+ listHostDevices: function(cap, suc, err) {
+ parameters = cap && "?_cap=" + cap
+ kimchi.requestJSON({
+ url : kimchi.url + 'host/devices' + parameters,
+ type : 'GET',
+ contentType : 'application/json',
+ dataType : 'json',
+ success : suc,
+ error : err
+ });
+ },
+
getStorageServers: function(type, suc, err) {
var url = kimchi.url + 'storageservers?_target_type=' + type;
kimchi.requestJSON({
--
1.8.5.3
10 years, 6 months
Planning for next release
by Aline Manera
Hi all,
In some days we will have Kimchi 1.2 released so we need to start
planning the next release.
I would like to ask to everyone input your ideas into the Backlog
<https://github.com/kimchi-project/kimchi/wiki/Todo-Backlog> page
More than add new features to Kimchi we need to think about improving
what is in Kimchi today.
Any suggestion is very welcome.
Thanks,
Aline Manera
10 years, 6 months
Call for translations
by Aline Manera
Hi all,
As Kimchi 1.2 will be released in some days we need to get all messages
translated.
So I would like to call for final translation of the code.
According to the following statistics, the current code needs some work:
en_US.po: 153 translated messages, 5 fuzzy translations, 240
untranslated messages.
pt_BR.po: 141 translated messages, 5 fuzzy translations, 252
untranslated messages.
zh_CN.po: 151 translated messages, 6 fuzzy translations, 241
untranslated messages.
Thanks for your help!
Aline Manera
10 years, 6 months
[PATCH] bug fix: instantiate the Yum manager when update the yum packages list
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
an instance just refresh packagekit once.
for example:
$ sudo PYTHONPATH=src python -c '
> from yum import YumBase
> YumBase().doPackageLists("updates")
> _yb = YumBase()
> _yb.doPackageLists("updates")
> _yb.doPackageLists("updates")
> '
Loaded plugins: langpacks, refresh-packagekit
Loaded plugins: langpacks, refresh-packagekit
you can seen the second _yb.doPackageLists will not refresh packagekit.
The apt manager may also has the same problem.
But not test it on ubuntu, will send a patch later after I have check.
Signed-off-by: Aline Manera <alinefm(a)br.ibm.com>
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
src/kimchi/swupdate.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/swupdate.py b/src/kimchi/swupdate.py
index ff5c9d1..dc48153 100644
--- a/src/kimchi/swupdate.py
+++ b/src/kimchi/swupdate.py
@@ -136,14 +136,14 @@ class YumUpdate(object):
"""
def __init__(self):
self._pkgs = {}
- self._yb = getattr(__import__('yum'), 'YumBase')()
+ self._yb = getattr(__import__('yum'), 'YumBase')
self.update_cmd = ["yum", "-y", "update"]
def _refreshUpdateList(self):
"""
Update the list of packages to be updated in the system.
"""
- self._pkgs = self._yb.doPackageLists('updates')
+ self._pkgs = self._yb().doPackageLists('updates')
def getPackagesList(self):
"""
--
1.8.5.3
10 years, 6 months
[PATCH] run pyflakes when make check
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
Pyflakes analyzes programs and detects various errors. It works by
parsing the source file, not importing it, so it is safe to use on
modules with side effects. It's also much faster.
This is important to improve the code quality.
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
Signed-off-by: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
---
Makefile.am | 7 +++++++
configure.ac | 7 +++++++
2 files changed, 14 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index 2fdafb1..c68f050 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -71,7 +71,14 @@ PEP8_WHITELIST = \
tests/utils.py \
$(NULL)
+SKIP_PYFLAKES_ERR = "\./src/kimchi/websocket\.py"
+
check-local:
+ find . -path './.git' -prune -type f -o \
+ -name '*.py' -o -name '*.py.in' | xargs $(PYFLAKES) | \
+ grep -w -v $(SKIP_PYFLAKES_ERR) | \
+ while read LINE; do echo "$$LINE"; false; done
+
$(PEP8) --version
$(PEP8) --filename '*.py,*.py.in' $(PEP8_WHITELIST)
diff --git a/configure.ac b/configure.ac
index 365348f..a625f35 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,6 +42,13 @@ AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.10])
AC_PATH_PROG([CHEETAH], [cheetah], [/usr/bin/cheetah])
+# Checking for pyflakes
+AC_PATH_PROG([PYFLAKES], [pyflakes])
+if test "x$PYFLAKES" = "x"; then
+ AC_MSG_WARN([pyflakes not found])
+fi
+
+
AC_CONFIG_FILES([
po/Makefile.in
po/gen-pot
--
1.8.5.3
10 years, 6 months
[PATCH V5 0/4] check the python code with pyflakes
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
V4 -> V5
We do not need pyflakes to run or build Kimchi.
It is only used for developers to check code style.
V3 -> V4
address Rodrigo's comment.
add delete the cloned template in rollback.
V2 -> V3
address zhengsheng's comment.
improve the SKIP_PYFLAKES_ERR list.
V1 -> V2
address Crístian'comment:
remove the whole statement "info = self._get_vm(name).inf"
address ming's comment:
break down the patch into small patches by the pyflakes error.
Pyflakes analyzes programs and detects various errors. It works by
parsing the source file, not importing it, so it is safe to use on
modules with side effects. It's also much faster.
This is important to improve the code quality.
ShaoHe Feng (4):
make pyflakes happly, remove the unused import module
make pyflakes happly, remove unused availables
add template_delete to rollback after create a template
run pyflakes when make check
Makefile.am | 7 +++++++
configure.ac | 7 +++++++
src/kimchi/control/plugins.py | 2 +-
src/kimchi/featuretests.py | 2 --
src/kimchi/mockmodel.py | 5 ++---
src/kimchi/model/storagepools.py | 2 +-
src/kimchi/screenshot.py | 1 -
src/kimchi/template.py | 1 -
tests/test_model.py | 2 ++
tests/test_server.py | 1 -
ui/pages/help/gen-index.py | 1 -
11 files changed, 20 insertions(+), 11 deletions(-)
--
1.8.5.3
10 years, 6 months
[PATCH v5] Remove debug report's file path from UI
by Mark Wu
Now the file path displayed on UI is "/data/debugreports/<reportname>/",
It's misleading because people could assume it's path on file system,
but it's the uri path in fact. We don't need expose the URI path because
the download button can help user to get the file. So this patch removes
it from UI. And this patch also renames debug report's 'file' attribute
to 'uri', because we use it to represent the download uri path.
Signed-off-by: Mark Wu <wudxw(a)linux.vnet.ibm.com>
---
docs/API.md | 2 +-
src/kimchi/control/debugreports.py | 4 ++--
src/kimchi/mockmodel.py | 2 +-
src/kimchi/model/debugreports.py | 2 +-
tests/test_rest.py | 2 +-
ui/css/theme-default/host.css | 4 ----
ui/js/src/kimchi.host.js | 4 ----
ui/pages/i18n.html.tmpl | 1 -
8 files changed, 6 insertions(+), 15 deletions(-)
diff --git a/docs/API.md b/docs/API.md
index 8d6682b..a380558 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -672,7 +672,7 @@ specific to the low level collection tool being used.
* **GET**: Retrieve the full description of Debug Report
* name: The debug report name used to identify the report
- * file: The debug report file name used to identify the report
+ * uri: The URI path to download a debug report
* time: The time when the debug report is created
* **DELETE**: Remove the Debug Report
diff --git a/src/kimchi/control/debugreports.py b/src/kimchi/control/debugreports.py
index 9922cfa..3c12230 100644
--- a/src/kimchi/control/debugreports.py
+++ b/src/kimchi/control/debugreports.py
@@ -37,7 +37,7 @@ class DebugReport(Resource):
@property
def data(self):
return {'name': self.ident,
- 'file': self.info['file'],
+ 'uri': self.info['uri'],
'time': self.info['ctime']}
@@ -47,4 +47,4 @@ class DebugReportContent(Resource):
def get(self):
self.lookup()
- raise internal_redirect(self.info['file'])
+ raise internal_redirect(self.info['uri'])
diff --git a/src/kimchi/mockmodel.py b/src/kimchi/mockmodel.py
index d40f61a..01480f4 100644
--- a/src/kimchi/mockmodel.py
+++ b/src/kimchi/mockmodel.py
@@ -311,7 +311,7 @@ class MockModel(object):
ctime = time.strftime("%Y-%m-%d-%H:%M:%S", time.localtime(ctime))
file_target = os.path.split(file_target)[-1]
file_target = os.path.join("/data/debugreports", file_target)
- return {'file': file_target,
+ return {'uri': file_target,
'ctime': ctime}
def debugreportcontent_lookup(self, name):
diff --git a/src/kimchi/model/debugreports.py b/src/kimchi/model/debugreports.py
index c6e698b..6ae282a 100644
--- a/src/kimchi/model/debugreports.py
+++ b/src/kimchi/model/debugreports.py
@@ -162,7 +162,7 @@ class DebugReportModel(object):
ctime = time.strftime("%Y-%m-%d-%H:%M:%S", time.localtime(ctime))
file_target = os.path.split(file_target)[-1]
file_target = os.path.join("/data/debugreports", file_target)
- return {'file': file_target,
+ return {'uri': file_target,
'ctime': ctime}
def delete(self, name):
diff --git a/tests/test_rest.py b/tests/test_rest.py
index fe8d3c4..3f2e449 100644
--- a/tests/test_rest.py
+++ b/tests/test_rest.py
@@ -1507,7 +1507,7 @@ class RestTests(unittest.TestCase):
self.assertEquals(200, resp.status)
resp = request(host, port, '/debugreports/report1')
debugre = json.loads(resp.read())
- resp = request(host, port, debugre['file'])
+ resp = request(host, port, debugre['uri'])
self.assertEquals(200, resp.status)
def test_host(self):
diff --git a/ui/css/theme-default/host.css b/ui/css/theme-default/host.css
index 0f8b941..8af34f5 100644
--- a/ui/css/theme-default/host.css
+++ b/ui/css/theme-default/host.css
@@ -215,14 +215,10 @@
}
.debug-report-name,
-.debug-report-file,
.debug-report-time {
width: 200px;
}
-.debug-report-file {
- width: 300px;
-}
/* End of Debug Report */
/* Software Updates */
diff --git a/ui/js/src/kimchi.host.js b/ui/js/src/kimchi.host.js
index ae2ee7d..5d32c4a 100644
--- a/ui/js/src/kimchi.host.js
+++ b/ui/js/src/kimchi.host.js
@@ -188,10 +188,6 @@ kimchi.host_main = function() {
label: i18n['KCHDR6003M'],
'class': 'debug-report-name'
}, {
- name: 'file',
- label: i18n['KCHDR6004M'],
- 'class': 'debug-report-file'
- }, {
name: 'time',
label: i18n['KCHDR6005M'],
'class': 'debug-report-time'
diff --git a/ui/pages/i18n.html.tmpl b/ui/pages/i18n.html.tmpl
index 2f47e50..a626759 100644
--- a/ui/pages/i18n.html.tmpl
+++ b/ui/pages/i18n.html.tmpl
@@ -92,7 +92,6 @@ var i18n = {
'KCHDR6001M': "$_("Debug report will be removed permanently and can't be recovered. Do you want to continue?")",
'KCHDR6002M': "$_("Debug Reports")",
'KCHDR6003M': "$_("Name")",
- 'KCHDR6004M': "$_("File Path")",
'KCHDR6005M': "$_("Generated Time")",
'KCHDR6006M': "$_("Generate")",
'KCHDR6007M': "$_("Generating...")",
--
1.8.4.2
10 years, 6 months
[PATCH] partitions: Fix when disk does not have extended partition
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Disk may just have primary partitions,
this makes getExtendedPartition return none and
throw exception when refer to extended partition path.
Fix this by check whether extended partition exists.
Signed-off-by: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
---
src/kimchi/disks.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/disks.py b/src/kimchi/disks.py
index cada869..ce0c5bb 100644
--- a/src/kimchi/disks.py
+++ b/src/kimchi/disks.py
@@ -86,8 +86,8 @@ def _is_dev_extended_partition(devType, devNodePath):
return False
diskPath = devNodePath.rstrip('0123456789')
device = PDevice(diskPath)
- disk = PDisk(device)
- if disk.getExtendedPartition().path == devNodePath:
+ extended_part = PDisk(device).getExtendedPartition()
+ if extended_part and extended_part.path == devNodePath:
return True
return False
--
1.8.3.2
10 years, 6 months
[PATCH V2 1/2] bug fix: instantiate the Yum manager when update the yum packages list
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
an instance just refresh packagekit once.
for example:
$ sudo PYTHONPATH=src python -c '
> from yum import YumBase
> YumBase().doPackageLists("updates")
> _yb = YumBase()
> _yb.doPackageLists("updates")
> _yb.doPackageLists("updates")
> '
Loaded plugins: langpacks, refresh-packagekit
Loaded plugins: langpacks, refresh-packagekit
you can seen the second _yb.doPackageLists will not refresh packagekit.
The apt manager may also has the same problem.
But not test it on ubuntu, will send a patch later after I have check.
Signed-off-by: Aline Manera <alinefm(a)br.ibm.com>
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
src/kimchi/swupdate.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/kimchi/swupdate.py b/src/kimchi/swupdate.py
index 45f7920..3238e44 100644
--- a/src/kimchi/swupdate.py
+++ b/src/kimchi/swupdate.py
@@ -137,13 +137,13 @@ class YumUpdate(object):
"""
def __init__(self):
self._pkgs = {}
- self._yb = getattr(__import__('yum'), 'YumBase')()
self.update_cmd = ["yum", "-y", "update"]
def _refreshUpdateList(self):
"""
Update the list of packages to be updated in the system.
"""
+ self._yb = getattr(__import__('yum'), 'YumBase')()
self._pkgs = self._yb.doPackageLists('updates')
def getPackagesList(self):
--
1.8.5.3
10 years, 6 months