[PATCH 0/5] Add volume reference count
by lvroyce0210@gmail.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Attach volume to vm need a volume list to choose,
available volumes will be tracked by volume reference count.
Add this field to storage volume.
Royce Lv (5):
Fix vm disk path when it does not have source element
Add volume ref_cnt: update api.md
Add volume ref_cnt: Update controller and json schema
Add volume ref_cnt: Add model and mockmodel implementation
Add volume ref_cnt: Update test
docs/API.md | 3 +++
src/kimchi/API.json | 24 ++++++++++++++++++++++++
src/kimchi/control/storagevolumes.py | 1 +
src/kimchi/i18n.py | 3 +++
src/kimchi/mockmodel.py | 3 +++
src/kimchi/model/storagevolumes.py | 35 +++++++++++++++++++++++++++++++++--
src/kimchi/model/vmstorages.py | 23 +++++++++++++----------
tests/test_model.py | 4 ++++
tests/test_rest.py | 2 ++
9 files changed, 86 insertions(+), 12 deletions(-)
--
1.8.1.2
10 years, 10 months
[kimchi-devel][bug]test_model.py fails because of exception
by Royce Lv
Guys,
Recently I ran test cases and find all cases in model test with
exception fails. After investigate with Sheldon, we found it is because
now exception uses kimchi defined exceptions which involves
cherrypy.request.app.root, and this is not set when just run with
test_model.
Based on this, we hope we can set up a jenkins server and do test
when every patch get merged, also developers ourselves need to test
before submit with latest code rebased. So that error like this can be
discovered earlier.
10 years, 10 months
[PATCH] Make sure that only root user runs kimchi
by Ramon Medeiros
Modify server.py to accept only root user to run kimchi. This will avoid some
message errors if non-root users tries to run.
Test:
ramonn@jarvis:~/Gittrees/KIMCHI (master *)$ ./src/kimchid
You need root privileges to run this script.
Exiting.
ramonn@jarvis:~/Gittrees/KIMCHI (master *)$ $?
bash: 1: command not found...
ramonn@jarvis:~/Gittrees/KIMCHI (master *)$ sudo ./src/kimchid
Loading YumUpdate features.
[18/Feb/2014:09:54:05] ENGINE Bus STARTING
[18/Feb/2014:09:54:05] ENGINE Started monitor thread 'Autoreloader'.
[18/Feb/2014:09:54:05] ENGINE Started monitor thread '_TimeoutMonitor'.
WebSocket server settings:
- Listen on :64667
- Flash security policy server
- No SSL/TLS support (no cert file)
- proxying from :64667 to targets in /var/lib/kimchi/vnc-tokens
[18/Feb/2014:09:54:05] ENGINE Serving on 0.0.0.0:8000
[18/Feb/2014:09:54:05] ENGINE Serving on 0.0.0.0:8001
*** Running feature tests ***
127.0.0.1 - - [18/Feb/2014:09:54:05] "HEAD /images/icon-fedora.png HTTP/1.1" 200 4449 "" ""
127.0.0.1 - - [18/Feb/2014:09:54:05] "GET /images/icon-fedora.png HTTP/1.1" 206 4449 "" ""
127.0.0.1 - - [18/Feb/2014:09:54:05] "HEAD /images/icon-fedora.png HTTP/1.1" 200 4449 "" ""
127.0.0.1 - - [18/Feb/2014:09:54:05] "GET /images/icon-fedora.png HTTP/1.1" 206 4449 "" ""
*** Feature tests completed ***
Ramon Medeiros (1):
Forbid non-root users to start kimchi
src/kimchi/server.py | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
--
1.8.3.1
10 years, 10 months
[PATCH V2] Add software update action to Host resource
by Aline Manera
From: Aline Manera <alinefm(a)br.ibm.com>
V1 - V2:
- Make sure it is a POST method while updating system packages
Aline Manera (1):
Add software update action to Host resource
docs/API.md | 9 ++-------
src/kimchi/control/host.py | 21 +++++++++++----------
src/kimchi/mockmodel.py | 2 +-
src/kimchi/model/host.py | 34 ++++++++++++++++++----------------
tests/test_mockmodel.py | 2 +-
tests/test_rest.py | 2 +-
6 files changed, 34 insertions(+), 36 deletions(-)
--
1.7.10.4
10 years, 10 months
[PATCH] Fix PUT with invalid path raising 500 error
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Update vm disk path with a non-existent path will raise 500 error,
we need to raise invalid parameter error instead.
Signed-off-by: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
---
src/kimchi/model/vmstorages.py | 3 +--
tests/test_model.py | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/kimchi/model/vmstorages.py b/src/kimchi/model/vmstorages.py
index 1597d49..6f03e75 100644
--- a/src/kimchi/model/vmstorages.py
+++ b/src/kimchi/model/vmstorages.py
@@ -217,5 +217,4 @@ class VMStorageModel(object):
stgModel.create(vm_name, backup_params)
except:
pass
-
- raise OperationFailed("KCHCDROM0009E", {'error': e.message})
+ raise
diff --git a/tests/test_model.py b/tests/test_model.py
index 859f7bd..9ec7027 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -205,7 +205,7 @@ class ModelTests(unittest.TestCase):
# update path of existing cd with
# non existent iso
- self.assertRaises(OperationFailed, inst.vmstorage_update,
+ self.assertRaises(InvalidParameter, inst.vmstorage_update,
vm_name, cdrom_dev, {'path': wrong_iso_path})
# update path of existing cd with
--
1.8.1.2
10 years, 10 months
[PATCH V2] bug fix: make install help/*.html files once
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
Now Makefile install help/*.html twice.
Fix it.
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
ui/pages/help/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/pages/help/Makefile.am b/ui/pages/help/Makefile.am
index 61ea209..6b08668 100644
--- a/ui/pages/help/Makefile.am
+++ b/ui/pages/help/Makefile.am
@@ -17,7 +17,7 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.html)
+DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita))
DITA_XSL_FILE = dita-help.xsl
helpdir = $(datadir)/kimchi/ui/pages/help
--
1.8.4.2
10 years, 10 months
[PATCH] bug fix: make install both *.dita and *.html files
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
Now Makefile install help/*.html twice.
Fix it.
And also install help/*.dita
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
ui/pages/help/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/pages/help/Makefile.am b/ui/pages/help/Makefile.am
index 61ea209..f4eb7f5 100644
--- a/ui/pages/help/Makefile.am
+++ b/ui/pages/help/Makefile.am
@@ -17,7 +17,7 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.html)
+DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard *.dita)) $(wildcard *.dita)
DITA_XSL_FILE = dita-help.xsl
helpdir = $(datadir)/kimchi/ui/pages/help
--
1.8.4.2
10 years, 10 months
[PATCH 0/4] Add DITA help pages
by Crístian Viana
Hi!
This is the first patchset which adds the DITA help pages do Kimchi.
Please read each patch's comment to find out more details about them.
To test the new patches, run Kimchi (locally, via RPM or DEB) and type the
following URL:
http://localhost:8000/help/kimhstor.html
A simple HTML page should be displayed.
Crístian Viana (4):
doc: Add DITA help pages
doc: Add help files to dist packages
doc: Export the help pages to cherrypy
doc: Ignore the generated files
.gitignore | 1 +
configure.ac | 1 +
contrib/DEBIAN/control.in | 2 +-
contrib/kimchi.spec.fedora.in | 5 ++++
contrib/kimchi.spec.suse.in | 5 ++++
docs/README.md | 7 ++---
src/kimchi/server.py | 5 ++++
ui/pages/Makefile.am | 2 +-
ui/pages/help/Makefile.am | 34 +++++++++++++++++++++++++
ui/pages/help/dita-help.xsl | 24 ++++++++++++++++++
ui/pages/help/kimhstor.dita | 45 +++++++++++++++++++++++++++++++++
ui/pages/help/kimhtempl.dita | 59 +++++++++++++++++++++++++++++++++++++++++++
ui/pages/help/kimhvirtm.dita | 47 ++++++++++++++++++++++++++++++++++
13 files changed, 232 insertions(+), 5 deletions(-)
create mode 100644 ui/pages/help/Makefile.am
create mode 100644 ui/pages/help/dita-help.xsl
create mode 100644 ui/pages/help/kimhstor.dita
create mode 100644 ui/pages/help/kimhtempl.dita
create mode 100644 ui/pages/help/kimhvirtm.dita
--
1.8.5.3
10 years, 10 months
[PATCH 0/4] Add volume reference count
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Attach volume to vm need a volume list to choose,
available volumes will be tracked by volume reference count.
Add this field to storage volume.
Royce Lv (4):
Add volume ref_cnt: update api.md
Add volume ref_cnt: Update controller and json schema
Add volume ref_cnt: Add model and mockmodel implementation
Add volume ref_cnt: Update test
docs/API.md | 6 ++++++
src/kimchi/API.json | 24 ++++++++++++++++++++++++
src/kimchi/control/storagevolumes.py | 1 +
src/kimchi/i18n.py | 3 +++
src/kimchi/mockmodel.py | 3 +++
src/kimchi/model/storagevolumes.py | 21 +++++++++++++++++++++
tests/test_model.py | 4 ++++
tests/test_rest.py | 2 ++
8 files changed, 64 insertions(+)
--
1.8.1.2
10 years, 10 months
[PATCH] UI: Host Software Update Support
by Hongliang Wang
Added UI support for software updating. The Host Tab will initially
list available updates to user if there are any; or we will disable
"Update All" Button if no updates available.
Signed-off-by: Hongliang Wang <hlwang(a)linux.vnet.ibm.com>
---
ui/css/theme-default/host.css | 22 +++++++++++++++
ui/js/src/kimchi.api.js | 52 ++++++++++++++++++++++++++++++++++
ui/js/src/kimchi.host.js | 65 +++++++++++++++++++++++++++++++++++++++++++
ui/pages/i18n.html.tmpl | 9 ++++++
ui/pages/tabs/host.html.tmpl | 13 +++++++++
5 files changed, 161 insertions(+)
diff --git a/ui/css/theme-default/host.css b/ui/css/theme-default/host.css
index 67daeaf..1342ade 100644
--- a/ui/css/theme-default/host.css
+++ b/ui/css/theme-default/host.css
@@ -227,3 +227,25 @@
width: 300px;
}
/* End of Debug Report */
+
+/* Software Updates */
+.host-panel #software-updates-grid {
+ border-color: #ddd;
+ height: 300px;
+ width: 850px;
+}
+
+.software-update-id {
+ width: 30px;
+}
+
+.software-update-name,
+.software-update-repos {
+ width: 220px;
+}
+
+.software-update-version,
+.software-update-arch {
+ width: 190px;
+}
+/* End of Software Updates */
diff --git a/ui/js/src/kimchi.api.js b/ui/js/src/kimchi.api.js
index 6433fe0..c3a9516 100644
--- a/ui/js/src/kimchi.api.js
+++ b/ui/js/src/kimchi.api.js
@@ -731,5 +731,57 @@ var kimchi = {
success : suc,
error : err
});
+ },
+
+ listSoftwareUpdates : function(suc, err) {
+ kimchi.requestJSON({
+ url : kimchi.url + 'host/packagesupdate',
+ type : 'GET',
+ contentType : 'application/json',
+ dataType : 'json',
+ resend: true,
+ success : suc,
+ error : err
+ });
+ },
+
+ updateSoftwares : function(suc, err) {
+ var taskID = -1;
+ var onResponse = function(data) {
+ taskID = data['id'];
+ trackTask();
+ };
+
+ var trackTask = function() {
+ kimchi.getTask(taskID, onTaskResponse, err);
+ };
+
+ var onTaskResponse = function(result) {
+ var taskStatus = result['status'];
+ switch(taskStatus) {
+ case 'running':
+ setTimeout(function() {
+ trackTask();
+ }, 200);
+ break;
+ case 'finished':
+ suc(result);
+ break;
+ case 'failed':
+ err(result);
+ break;
+ default:
+ break;
+ }
+ };
+
+ kimchi.requestJSON({
+ url : kimchi.url + 'host/packagesupdate/update',
+ type : "POST",
+ contentType : "application/json",
+ dataType : "json",
+ success : onResponse,
+ error : err
+ });
}
};
diff --git a/ui/js/src/kimchi.host.js b/ui/js/src/kimchi.host.js
index a5c341b..882e2e9 100644
--- a/ui/js/src/kimchi.host.js
+++ b/ui/js/src/kimchi.host.js
@@ -131,6 +131,69 @@ kimchi.host_main = function() {
});
};
+ var softwareUpdatesGridID = 'software-updates-grid';
+ var softwareUpdatesGrid = null;
+ var initSoftwareUpdatesGrid = function(softwareUpdates) {
+ softwareUpdatesGrid = new kimchi.widget.Grid({
+ container: 'software-updates-grid-container',
+ id: softwareUpdatesGridID,
+ title: i18n['KCHUPD6001M'],
+ toolbarButtons: [{
+ id: softwareUpdatesGridID + '-update-button',
+ label: i18n['KCHUPD6006M'],
+ disabled: true,
+ onClick: function(event) {
+ var updateButton = $(this);
+ $(updateButton).text(i18n['KCHUPD6007M']).prop('disabled', true);
+ kimchi.updateSoftwares(function(result) {
+ $(updateButton).text(i18n['KCHUPD6006M']).prop('disabled', false);
+ });
+ }
+ }],
+ frozenFields: [{
+ name: 'id',
+ label: ' ',
+ 'class': 'software-update-id'
+ }],
+ fields: [{
+ name: 'package_name',
+ label: i18n['KCHUPD6002M'],
+ 'class': 'software-update-name'
+ }, {
+ name: 'version',
+ label: i18n['KCHUPD6003M'],
+ 'class': 'software-update-version'
+ }, {
+ name: 'arch',
+ label: i18n['KCHUPD6004M'],
+ 'class': 'software-update-arch'
+ }, {
+ name: 'repository',
+ label: i18n['KCHUPD6005M'],
+ 'class': 'software-update-repos'
+ }],
+ data: softwareUpdates
+ });
+ };
+
+ var listSoftwareUpdates = function() {
+ kimchi.listSoftwareUpdates(function(softwareUpdates) {
+ $(softwareUpdatesGridID + '-update-button')
+ .prop('disabled', softwareUpdates.length === 0);
+
+ $.each(softwareUpdates, function(i, item) {
+ softwareUpdates[i]['id'] = i + 1;
+ });
+
+ if(softwareUpdatesGrid) {
+ softwareUpdatesGrid.setData(softwareUpdates);
+ }
+ else {
+ initSoftwareUpdatesGrid(softwareUpdates);
+ }
+ });
+ };
+
var shutdownButtonID = '#host-button-shutdown';
var restartButtonID = '#host-button-restart';
var shutdownHost = function(params) {
@@ -189,6 +252,8 @@ kimchi.host_main = function() {
kimchi.keepMonitoringHost = this['checked'];
});
+ listSoftwareUpdates();
+
kimchi.getCapabilities(function(capabilities) {
if(!capabilities['system_report_tool']) {
return;
diff --git a/ui/pages/i18n.html.tmpl b/ui/pages/i18n.html.tmpl
index 098a0a9..a9d86b3 100644
--- a/ui/pages/i18n.html.tmpl
+++ b/ui/pages/i18n.html.tmpl
@@ -94,6 +94,15 @@ var i18n = {
'KCHDR6010M': "$_("Download")",
+ 'KCHUPD6001M': "$_("Software Updates")",
+ 'KCHUPD6002M': "$_("Package Name")",
+ 'KCHUPD6003M': "$_("Version")",
+ 'KCHUPD6004M': "$_("Architecture")",
+ 'KCHUPD6005M': "$_("Repository")",
+ 'KCHUPD6006M': "$_("Update All")",
+ 'KCHUPD6007M': "$_("Updating...")",
+
+
'KCHVM6001M': "$_("This will delete the virtual machine and its virtual disks. This operation cannot be undone. Would you like to continue?")",
'KCHNET6001E': "$_("The VLAN id must be between 1 and 4094.")",
diff --git a/ui/pages/tabs/host.html.tmpl b/ui/pages/tabs/host.html.tmpl
index d32773a..3ebb809 100644
--- a/ui/pages/tabs/host.html.tmpl
+++ b/ui/pages/tabs/host.html.tmpl
@@ -123,6 +123,19 @@
</div>
</div>
</div>
+ <div id="software-update-section" class="host-section">
+ <h3 class="section-header"
+ aria-controls="content-software-update">
+ $_("Software Updates")
+ </h3>
+ <div id="content-software-update" class="section-content">
+ <div class="section-row">
+ <div class="section-value">
+ <div id="software-updates-grid-container"></div>
+ </div>
+ </div>
+ </div>
+ </div>
<div id="debug-report-section" class="host-section hidden">
<h3 class="section-header"
aria-controls="content-sys-reports">
--
1.8.1.4
10 years, 10 months