[PATCH] mockmodel: Reset packages after updating system
by Aline Manera
From: Aline Manera <alinefm(a)br.ibm.com>
After updating system any more packages should be listed or user will
think the update failed.
Signed-off-by: Aline Manera <alinefm(a)br.ibm.com>
---
src/kimchi/mockmodel.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/kimchi/mockmodel.py b/src/kimchi/mockmodel.py
index b70cc1b..743c7c6 100644
--- a/src/kimchi/mockmodel.py
+++ b/src/kimchi/mockmodel.py
@@ -1122,6 +1122,10 @@ class MockSoftwareUpdate(object):
msgs.append("All packages updated")
cb('\n'.join(msgs), True)
+ # After updating all packages any package should be listed to be
+ # updated, so reset self._packages
+ self._packages = {}
+
class MockRepositories(object):
def __init__(self):
--
1.7.10.4
10 years, 9 months
[PATCH v2 0/4] Host Repository Management Support
by Hongliang Wang
Add host repositories management in this patch set.
Please apply the following patch first:
* [UI] Grid Enhancement - "title" Attribute for Long Values
Know issues:
* Editing a repository will always fails because back-end responds
an error:
KCHAPI0004E: Parameters is_mirror are not allowed to be updated
in repository
v1 -> v2:
2a) Removed "Repository" in column names
(Adam King's comment)
2b) Adjust column name sequence
(Adam King's comment)
2c) Enabled is_mirror radio button in edit window
(Adam King's comment)
Hongliang Wang (4):
Add i18n Strings for Repositories Management
Add API Support for Repositories Management
Add/Edit Repository Support
Integrate Repositories Management into Host Tab
po/POTFILES.in | 2 +
ui/css/theme-default/host.css | 40 ++++++++++
ui/css/theme-default/repository-add.css | 39 ++++++++++
ui/css/theme-default/repository-edit.css | 69 +++++++++++++++++
ui/js/src/kimchi.api.js | 61 +++++++++++++++
ui/js/src/kimchi.host.js | 123 +++++++++++++++++++++++++++++++
ui/js/src/kimchi.repository_add_main.js | 84 +++++++++++++++++++++
ui/js/src/kimchi.repository_edit_main.js | 85 +++++++++++++++++++++
ui/pages/i18n.html.tmpl | 18 +++++
ui/pages/repository-add.html.tmpl | 104 ++++++++++++++++++++++++++
ui/pages/repository-edit.html.tmpl | 121 ++++++++++++++++++++++++++++++
ui/pages/tabs/host.html.tmpl | 13 ++++
12 files changed, 759 insertions(+)
create mode 100644 ui/css/theme-default/repository-add.css
create mode 100644 ui/css/theme-default/repository-edit.css
create mode 100644 ui/js/src/kimchi.repository_add_main.js
create mode 100644 ui/js/src/kimchi.repository_edit_main.js
create mode 100644 ui/pages/repository-add.html.tmpl
create mode 100644 ui/pages/repository-edit.html.tmpl
--
1.8.1.4
10 years, 9 months
[PATCH v3 0/5] [UI] Host Repository Management Support
by Hongliang Wang
Add host repositories management in this patch set.
v2 -> v3:
3a) Added enable/disable repository function in grid toolbar button
(Adam King's comment)
v1 -> v2:
2a) Removed "Repository" in column names
(Adam King's comment)
2b) Adjust column name sequence
(Adam King's comment)
2c) Enabled is_mirror radio button in edit window
(Adam King's comment)
Hongliang Wang (5):
[UI] Repository Management - Add i18n Strings
[UI] Repository Management - Add API Support
[UI] Repository Management - Add Repository Support
[UI] Repository Management - Edit Repository Support
[UI] Repository Management - Integrate into Host Tab
po/POTFILES.in | 2 +
ui/css/theme-default/host.css | 40 ++++++++
ui/css/theme-default/repository-add.css | 39 +++++++
ui/css/theme-default/repository-edit.css | 69 +++++++++++++
ui/js/src/kimchi.api.js | 76 +++++++++++++-
ui/js/src/kimchi.host.js | 170 +++++++++++++++++++++++++++++++
ui/js/src/kimchi.repository_add_main.js | 84 +++++++++++++++
ui/js/src/kimchi.repository_edit_main.js | 85 ++++++++++++++++
ui/pages/i18n.html.tmpl | 19 ++++
ui/pages/repository-add.html.tmpl | 104 +++++++++++++++++++
ui/pages/repository-edit.html.tmpl | 110 ++++++++++++++++++++
ui/pages/tabs/host.html.tmpl | 13 +++
12 files changed, 810 insertions(+), 1 deletion(-)
create mode 100644 ui/css/theme-default/repository-add.css
create mode 100644 ui/css/theme-default/repository-edit.css
create mode 100644 ui/js/src/kimchi.repository_add_main.js
create mode 100644 ui/js/src/kimchi.repository_edit_main.js
create mode 100644 ui/pages/repository-add.html.tmpl
create mode 100644 ui/pages/repository-edit.html.tmpl
--
1.8.1.4
10 years, 9 months
[PATCH v2] [UI] Grid Loading Mask - Some Elements are Missing
by Hongliang Wang
Some elements were lost and add them back here:
1) Show a message under the icon
2) Put the icon and text in the center both horizontally and vertically
3) Give the mask a opacity value
4) Hide the mask initially
v1 -> v2:
2a) Rebased.
Signed-off-by: Hongliang Wang <hlwang(a)linux.vnet.ibm.com>
---
ui/css/theme-default/grid.css | 13 +++++++------
ui/js/src/kimchi.grid.js | 4 +++-
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/ui/css/theme-default/grid.css b/ui/css/theme-default/grid.css
index 958bdb0..44ae614 100644
--- a/ui/css/theme-default/grid.css
+++ b/ui/css/theme-default/grid.css
@@ -214,27 +214,28 @@
}
.grid-mask {
+ background: rgba(190, 190, 190, .9);
bottom: 0;
left: 0;
position: absolute;
right: 0;
- top: 48px;
+ z-index: 5;
}
.grid-loading {
bottom: 0;
- height: 100%;
+ height: 68px;
left: 0;
margin: auto;
+ position: absolute;
right: 0;
text-align: center;
top: 0;
- width: 100%;
+ width: 49px;
}
.grid-loading-icon {
background: url("../images/theme-default/kimchi-loading.gif") no-repeat left top;
- height: 100%;
- width: 100%;
- background-position: center;
+ height: 48px;
+ width: 49px;
}
diff --git a/ui/js/src/kimchi.grid.js b/ui/js/src/kimchi.grid.js
index 2e3d0ed..7360b36 100644
--- a/ui/js/src/kimchi.grid.js
+++ b/ui/js/src/kimchi.grid.js
@@ -57,7 +57,9 @@ kimchi.widget.Grid = function(params) {
'<div class="grid-mask hidden">',
'<div class="grid-loading">',
'<div class="grid-loading-icon"></div>',
- '<div class="grid-loading-text"></div>',
+ '<div class="grid-loading-text">',
+ i18n['KCHGRD6001M'],
+ '</div>',
'</div>',
'</div>',
'</div>'
--
1.8.1.4
10 years, 9 months
[RFC][PATCH] Do not allow user deactivate/delete storage pool used by vms
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
Make a integrity verification when user try to deactivate or delete a
pool.
If a volume of a pool is used by a vm, the pool should not be deactivated
or deleted to avoid problems.
It is no harmful to allow to deactivate/delete dir pool, for
kimchi does not delete the pool path when delete this pool.
But it is harmful for other type pools, such as logical or nfs pool.
Royce has added a ref_cnt for volume, if the sum of ref_cnt in this pool
larger than 0, means this pool is used by some vms.
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
src/kimchi/i18n.py | 2 ++
src/kimchi/model/storagepools.py | 23 +++++++++++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/src/kimchi/i18n.py b/src/kimchi/i18n.py
index 1ae3889..7c8fbc7 100644
--- a/src/kimchi/i18n.py
+++ b/src/kimchi/i18n.py
@@ -144,6 +144,8 @@ messages = {
"KCHPOOL0034E": _("Unable to deactivate pool %(name)s as it is associated with some templates"),
"KCHPOOL0035E": _("Unable to delete pool %(name)s as it is associated with some templates"),
"KCHPOOL0036E": _("A volume group named '%(name)s' already exists. Please, choose another name to create the logical pool."),
+ "KCHPOOL0037E": _("Unable to deactivate pool %(name)s as it is used by some vms"),
+ "KCHPOOL0038E": _("Unable to delete pool %(name)s as it is used by some vms"),
"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 fea19f6..247c374 100644
--- a/src/kimchi/model/storagepools.py
+++ b/src/kimchi/model/storagepools.py
@@ -179,6 +179,16 @@ class StoragePoolModel(object):
else:
raise
+ def _get_volumes_ref_cnt(self, name):
+ # in order to avoid nested import
+ from kimchi.model.storagevolumes import StorageVolumesModel
+ from kimchi.model.storagevolumes import StorageVolumeModel
+ kwargs = {"conn": self.conn, "objstore": self.objstore}
+ cnts = [StorageVolumeModel(**kwargs).lookup(name, volume)["ref_cnt"]
+ for volume in StorageVolumesModel(**kwargs).get_list(name)]
+
+ return sum(cnts)
+
def _get_storagepool_vols_num(self, pool):
try:
if pool.isActive():
@@ -345,6 +355,9 @@ class StoragePoolModel(object):
raise InvalidOperation('KCHPOOL0034E', {'name': name})
pool = self.get_storagepool(name, self.conn)
+ if pool.isActive() and self._get_volumes_ref_cnt(name) > 0:
+ raise InvalidOperation('KCHPOOL0037E', {'name': name})
+
#FIXME: nfs workaround - do not try to deactivate a NFS pool
# if the NFS server is not reachable.
xml = pool.XMLDesc(0)
@@ -374,6 +387,16 @@ class StoragePoolModel(object):
if pool.isActive():
raise InvalidOperation("KCHPOOL0005E", {'name': name})
try:
+ try:
+ pool.create(0)
+ except Exception:
+ pass
+ else:
+ if self._get_volumes_ref_cnt(name) > 0:
+ pool.destroy()
+ raise InvalidOperation('KCHPOOL0038E', {'name': name})
+ else:
+ pool.destroy()
pool.undefine()
except libvirt.libvirtError as e:
raise OperationFailed("KCHPOOL0011E",
--
1.8.4.2
10 years, 9 months
[PATCH 0/2] Do not allow user disable/delete a network used by VM or template
by Aline Manera
From: Aline Manera <alinefm(a)br.ibm.com>
Aline Manera (2):
Do not allow user disable/delete a network used by VM or template
UI: Disable stop/undefine buttons when network is in use
docs/API.md | 2 ++
src/kimchi/control/networks.py | 1 +
src/kimchi/i18n.py | 4 ++--
src/kimchi/mockmodel.py | 24 ++++++++++++++++++++++++
src/kimchi/model/networks.py | 31 +++++++++++++++++++++++++++----
tests/test_model.py | 3 +--
tests/test_rest.py | 6 +++---
ui/js/src/kimchi.network.js | 27 ++++++++++++++++++++-------
ui/pages/tabs/network.html.tmpl | 2 +-
9 files changed, 81 insertions(+), 19 deletions(-)
--
1.7.10.4
10 years, 9 months
[PATCH 0/2 V2] Do not allow user disable/delete a network used by VM or template
by Aline Manera
From: Aline Manera <alinefm(a)br.ibm.com>
v1 -> V2:
- Update test cases (by Royce)
- Make function names uniform (by Ming)
Aline Manera (2):
Do not allow user disable/delete a network used by VM or template
UI: Disable stop/undefine buttons when network is in use
docs/API.md | 2 ++
src/kimchi/control/networks.py | 1 +
src/kimchi/i18n.py | 4 ++--
src/kimchi/mockmodel.py | 24 ++++++++++++++++++++++++
src/kimchi/model/networks.py | 31 +++++++++++++++++++++++++++----
tests/test_model.py | 18 +++++++++++++++---
tests/test_rest.py | 12 ++++++++++--
ui/js/src/kimchi.network.js | 27 ++++++++++++++++++++-------
ui/pages/tabs/network.html.tmpl | 2 +-
9 files changed, 102 insertions(+), 19 deletions(-)
--
1.7.10.4
10 years, 9 months
[PATCH 0/2] Change cdrom default bus type to scsi
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
tested:
1. sudo ./run_test.sh
2. create vm with a scsi cdrom successful install
3. add more than 4 cdrom success
Royce Lv (2):
Issue#338: Change the default cdrom bus to scsi
Fix feature tests xml
src/kimchi/featuretests.py | 6 +++---
src/kimchi/model/vmstorages.py | 2 +-
src/kimchi/osinfo.py | 6 ++++--
3 files changed, 8 insertions(+), 6 deletions(-)
--
1.8.1.2
10 years, 9 months
[RFC] Github #329: Kimchi must not run as root
by Daniel H Barboza
Information about the issue:
https://github.com/kimchi-project/kimchi/issues/329
We had some ideas about it in the last weekly scrum:
- creating an user 'kimchi' with a lot of privileges. It is the simplest
of the solutions but
implies in a lot of annoyances (different system paths between distros,
libvirt does not
work the same way in all distros). There is no tell about the amount of
new bugs and
issues that shall emerge from such change.
- Separating the UI and the backend. This is my personal favourite but I
believe it is also
the hardest. We can implement this by separating frontend and backend
as 2 separate cherrypy processes, the backend runs as root and the
frontend runs as a
regular user. The communication would be done using the REST API. The
other approach
would be the backend running as a regular python daemon, with root
privileges, and
kimchi would communicate with it using RPC. I believe the latter is more
elegant and the
former is easier to implement.
Things to consider:
- Distro support: Ubuntu, for example, behaves very different from
Fedora as far as
libvirt is concerned. The packaging model (apt-get instead of yum)
differs in support
as well. I think it's a fair guess that RHEL 6 and Suse will have
different behavior as well.
- VM visibility: in the first idea (different user) only the VMs created
by this specific user
would be visible to kimchi, unless we do something about it (tweaking
libvirt configuration
perhaps?).
- User authentication. Right now the user authentication presented in
kimchi exists simply
to authenticate it as a regular user of the host. The owner of the
process will be root, doesn't
matter which user logs in (and I guess this is the critical security
flaw we have). Do we need
ro rethink the authentication model as well?
Please provide your input and ideas!
Daniel
10 years, 9 months