[PATCH] [Kimchi] [RFC] Storave Volume management UI
by sguimaraes943@gmail.com
From: Samuel Guimarães <sguimaraes943(a)gmail.com>
This patch adds the UI for Storage Volume management action button, filter input, gallery view and gallery / list view toggle-switch button with multi-selection enabled.
This is just the initial patch for the UI to get feedback, will add Storage Volume modal and confirm windows and map create, delete, resize, wipe and clone actions in the next commit.
Samuel Guimarães (1):
Storave Volume management UI
ui/css/kimchi.css | 266 +++++++++++++++++++++++++++++-------
ui/css/src/modules/_storage.scss | 287 +++++++++++++++++++++++++++++++++------
ui/js/src/kimchi.storage_main.js | 82 +++++------
ui/pages/tabs/storage.html.tmpl | 121 +++++++++++------
4 files changed, 576 insertions(+), 180 deletions(-)
--
1.9.3
8 years, 7 months
[RFC] [Kimchi] First pass at Edit Virtual Network UI
by Socorro Stoppler
- First attempt of Edit Virtual Network UI
- Known UI Issues:s
- after the update happens, the list of networks are not shown properly (i.e. rows are all bunched up and actions buttons are diagonal, but fixes itself
after you move off the tab and come back to it
- when edit panel first opens up, the value for the Destination selector (if applicable) is either showing 'Nothing selected' or it's showing the first item on the list
rather than the value that came from backend
- Bridged network has not been tested so there's bound to be issues there
Proposal:
Per discussion w/Lucio, with regards to vlan_id, I'd like to propose to have the backend show the vlan_id as a separate field.
This came about when I couldn't find that field and as it turns out, it was because it was appended to the interface name.s
Socorro Stoppler (1):
First pass Edit Virtual Network
ui/js/src/kimchi.api.js | 23 ++++
ui/js/src/kimchi.network.js | 14 +++
ui/js/src/kimchi.network_edit_main.js | 216 ++++++++++++++++++++++++++++++++++
ui/pages/network-edit.html.tmpl | 75 ++++++++++++
ui/pages/tabs/network.html.tmpl | 3 +-
5 files changed, 330 insertions(+), 1 deletion(-)
create mode 100644 ui/js/src/kimchi.network_edit_main.js
create mode 100644 ui/pages/network-edit.html.tmpl
--
2.5.0
8 years, 7 months
[PATCH] [Kimchi] Fix issue on network update
by Lucio Correia
When network is not renamed, we need 'name' value in info
dict, since name will not be returned by GET.
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
---
model/networks.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/model/networks.py b/model/networks.py
index 333ea6d..cc59ca8 100644
--- a/model/networks.py
+++ b/model/networks.py
@@ -504,8 +504,8 @@ class NetworkModel(object):
def update(self, name, params):
info = self.lookup(name)
+ info['name'] = name
original = copy.deepcopy(info)
- original['name'] = name
# validate update parameters
connection = info['connection']
--
1.9.1
8 years, 7 months
[PATCH] [Wok] Bug fix: Add space to separate class names
by Aline Manera
Commit d4b0c5, added the following:
'data-converter=' + fields[i]["converter"] : ''
but as it is string concatenation, we need to add an space before
"data-converter" to do not wrongly merge strings.
' data-converter=' + fields[i]["converter"] : '',
This turns back the plugin color when displaying user log activity.
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
ui/js/wok.bootgrid.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/js/wok.bootgrid.js b/ui/js/wok.bootgrid.js
index c4082dd..7d634bb 100644
--- a/ui/js/wok.bootgrid.js
+++ b/ui/js/wok.bootgrid.js
@@ -50,7 +50,7 @@ wok.createBootgrid = function(opts) {
for (var i = 0; i < fields.length; i++) {
var columnHtml = [
- '<th data-type="', fields[i]["type"], '" data-column-id="', fields[i]["column-id"], '"', (fields[i].identifier) ? 'data-identifier="true"' : '', ("header-class" in fields[i]) ? 'data-header-css-class="gridHeader ' + fields[i]["header-class"] + '"' : 'gridHeader', ("data-class" in fields[i]) ? ' data-align="' + fields[i]["data-class"] + '"' + ' headerAlign="center"' : ' data-align="left" headerAlign="center"', ("formatter" in fields[i]) ? 'data-formatter=' + fields[i]["formatter"] : '', (fields[i].width) ? (' data-width="' + fields[i].width + '"') : '', ("converter" in fields[i]) ? 'data-converter=' + fields[i]["converter"] : '',
+ '<th data-type="', fields[i]["type"], '" data-column-id="', fields[i]["column-id"], '"', (fields[i].identifier) ? 'data-identifier="true"' : '', ("header-class" in fields[i]) ? 'data-header-css-class="gridHeader ' + fields[i]["header-class"] + '"' : 'gridHeader', ("data-class" in fields[i]) ? ' data-align="' + fields[i]["data-class"] + '"' + ' headerAlign="center"' : ' data-align="left" headerAlign="center"', ("formatter" in fields[i]) ? 'data-formatter=' + fields[i]["formatter"] : '', (fields[i].width) ? (' data-width="' + fields[i].width + '"') : '', ("converter" in fields[i]) ? ' data-converter=' + fields[i]["converter"] : '',
'>', ("title" in fields[i]) ? fields[i]["title"] : fields[i]["column-id"],
'</th>'
].join('');
--
2.5.5
8 years, 7 months
[PATCH V2] [Kimchi 0/3] Issue #201: Handling libvirt connection failures.
by pvital@linux.vnet.ibm.com
From: Paulo Vital <pvital(a)linux.vnet.ibm.com>
V1 -> V2:
* Adapted to use the latest notifications changes from Wok
* Aesthetic changes
V1:
This is the backend part of the solution to solve issue #201. Frontend still
needs some updates to provide more information to user.
Paulo Vital (3):
Update Kimchi config file for Systemd service
Make Cheerypy up if not able to connect to libvirt
Add support to check if libvirtd is running.
contrib/kimchid.service.fedora | 3 ++-
contrib/kimchid.service.ubuntu | 3 ++-
i18n.py | 3 +++
model/config.py | 17 +++++++++++++++--
model/libvirtconnection.py | 13 +++++++++++--
model/templates.py | 5 ++++-
utils.py | 16 +++++++++++++++-
7 files changed, 52 insertions(+), 8 deletions(-)
--
2.5.5
8 years, 7 months
[PATCH] [Kimchi 2/2] Use verbs in the past
by Lucio Correia
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
---
i18n.py | 86 ++++++++++++++++++++++++++++++++---------------------------------
1 file changed, 43 insertions(+), 43 deletions(-)
diff --git a/i18n.py b/i18n.py
index 7baa3b6..2b8c205 100644
--- a/i18n.py
+++ b/i18n.py
@@ -332,48 +332,48 @@ messages = {
"KCHLVMS0001E": _("Invalid volume group name parameter: %(name)s."),
# These messages (ending with L) are for user log purposes
- "KCHNET0001L": _("Create %(connection)s virtual network '%(name)s'"),
- "KCHNET0002L": _("Remove virtual network '%(ident)s'"),
- "KCHNET0003L": _("Update virtual network '%(ident)s'"),
- "KCHNET0004L": _("Activate virtual network '%(ident)s'"),
- "KCHNET0005L": _("Deactivate virtual network '%(ident)s'"),
- "KCHPOOL0001L": _("Create %(type)s storage pool '%(name)s'"),
- "KCHPOOL0002L": _("Remove storage pool '%(ident)s'"),
- "KCHPOOL0003L": _("Update storage pool '%(ident)s'"),
- "KCHPOOL0004L": _("Activate storage pool '%(ident)s'"),
- "KCHPOOL0005L": _("Deactivate storage pool '%(ident)s'"),
- "KCHSNAP0001L": _("Create snapshot '%(name)s' at guest '%(vm)s'"),
- "KCHSNAP0002L": _("Remove snapshot '%(ident)s' from guest '%(vm)s'"),
- "KCHSNAP0003L": _("Revert guest '%(vm)s' to snapshot '%(ident)s'"),
- "KCHTMPL0001L": _("Create template '%(name)s'"),
- "KCHTMPL0002L": _("Remove template '%(ident)s'"),
- "KCHTMPL0003L": _("Update template '%(ident)s'"),
- "KCHTMPL0004L": _("Clone template '%(ident)s'"),
- "KCHVM0001L": _("Create guest '%(name)s' from template '%(template)s'"),
- "KCHVM0002L": _("Remove guest '%(ident)s'"),
- "KCHVM0003L": _("Edit guest '%(ident)s'"),
- "KCHVM0004L": _("Start guest '%(ident)s'"),
- "KCHVM0005L": _("Power off guest '%(ident)s'"),
+ "KCHNET0001L": _("Created %(connection)s virtual network '%(name)s'"),
+ "KCHNET0002L": _("Removed virtual network '%(ident)s'"),
+ "KCHNET0003L": _("Updated virtual network '%(ident)s'"),
+ "KCHNET0004L": _("Activated virtual network '%(ident)s'"),
+ "KCHNET0005L": _("Deactivated virtual network '%(ident)s'"),
+ "KCHPOOL0001L": _("Created %(type)s storage pool '%(name)s'"),
+ "KCHPOOL0002L": _("Removed storage pool '%(ident)s'"),
+ "KCHPOOL0003L": _("Updated storage pool '%(ident)s'"),
+ "KCHPOOL0004L": _("Activated storage pool '%(ident)s'"),
+ "KCHPOOL0005L": _("Deactivated storage pool '%(ident)s'"),
+ "KCHSNAP0001L": _("Created snapshot '%(name)s' at guest '%(vm)s'"),
+ "KCHSNAP0002L": _("Removed snapshot '%(ident)s' from guest '%(vm)s'"),
+ "KCHSNAP0003L": _("Reverted guest '%(vm)s' to snapshot '%(ident)s'"),
+ "KCHTMPL0001L": _("Created template '%(name)s'"),
+ "KCHTMPL0002L": _("Removed template '%(ident)s'"),
+ "KCHTMPL0003L": _("Updated template '%(ident)s'"),
+ "KCHTMPL0004L": _("Cloned template '%(ident)s'"),
+ "KCHVM0001L": _("Created guest '%(name)s' from template '%(template)s'"),
+ "KCHVM0002L": _("Removed guest '%(ident)s'"),
+ "KCHVM0003L": _("Edited guest '%(ident)s'"),
+ "KCHVM0004L": _("Started guest '%(ident)s'"),
+ "KCHVM0005L": _("Powered off guest '%(ident)s'"),
"KCHVM0006L": _("Shutdown guest '%(ident)s'"),
- "KCHVM0007L": _("Restart guest '%(ident)s'"),
- "KCHVM0008L": _("Connect to guest '%(ident)s' through novnc/spice"),
- "KCHVM0009L": _("Clone guest '%(ident)s'"),
- "KCHVM0010L": _("Migrate guest '%(ident)s' to '%(remote_host)s'"),
- "KCHVM0011L": _("Suspend guest '%(ident)s'"),
- "KCHVM0012L": _("Resume guest '%(ident)s'"),
- "KCHVM0013L": _("Connect to guest '%(ident)s' through serial"),
- "KCHVMHDEV0001L": _("Attach host device '%(name)s' to guest '%(vmid)s'"),
- "KCHVMHDEV0002L": _("Detach host device '%(ident)s' from guest '%(vmid)s'"),
- "KCHVMIF0001L": _("Attach network interface '%(network)s' to guest '%(vm)s'"),
- "KCHVMIF0002L": _("Detach network interface '%(ident)s' from guest '%(vm)s'"),
- "KCHVMIF0003L": _("Update network interface '%(ident)s' at guest '%(vm)s'"),
- "KCHVMSTOR0001L": _("Attach %(type)s storage '%(path)s' to guest '%(vm)s'"),
- "KCHVMSTOR0002L": _("Remove storage '%(ident)s' from guest '%(vm)s'"),
- "KCHVMSTOR0003L": _("Update storage '%(ident)s' at guest '%(vm)s'"),
- "KCHVOL0001L": _("Create storage volume '%(name)s' at pool '%(pool)s'"),
- "KCHVOL0002L": _("Remove storage volume '%(ident)s' from pool '%(pool)s'"),
- "KCHVOL0003L": _("Update storage volume '%(ident)s' at pool '%(pool)s'"),
- "KCHVOL0004L": _("Wipe storage volume '%(ident)s' off pool '%(pool)s'"),
- "KCHVOL0005L": _("Resize storage volume '%(ident)s' at pool '%(pool)s' with size %(size)s"),
- "KCHVOL0006L": _("Clone storage volume '%(ident)s' at pool '%(pool)s'"),
+ "KCHVM0007L": _("Restarted guest '%(ident)s'"),
+ "KCHVM0008L": _("Connected to guest '%(ident)s' through novnc/spice"),
+ "KCHVM0009L": _("Cloned guest '%(ident)s'"),
+ "KCHVM0010L": _("Migrated guest '%(ident)s' to '%(remote_host)s'"),
+ "KCHVM0011L": _("Suspended guest '%(ident)s'"),
+ "KCHVM0012L": _("Resumed guest '%(ident)s'"),
+ "KCHVM0013L": _("Connected to guest '%(ident)s' through serial"),
+ "KCHVMHDEV0001L": _("Attached host device '%(name)s' to guest '%(vmid)s'"),
+ "KCHVMHDEV0002L": _("Detached host device '%(ident)s' from guest '%(vmid)s'"),
+ "KCHVMIF0001L": _("Attached network interface '%(network)s' to guest '%(vm)s'"),
+ "KCHVMIF0002L": _("Detached network interface '%(ident)s' from guest '%(vm)s'"),
+ "KCHVMIF0003L": _("Updated network interface '%(ident)s' at guest '%(vm)s'"),
+ "KCHVMSTOR0001L": _("Attached %(type)s storage '%(path)s' to guest '%(vm)s'"),
+ "KCHVMSTOR0002L": _("Removed storage '%(ident)s' from guest '%(vm)s'"),
+ "KCHVMSTOR0003L": _("Updated storage '%(ident)s' at guest '%(vm)s'"),
+ "KCHVOL0001L": _("Created storage volume '%(name)s' at pool '%(pool)s'"),
+ "KCHVOL0002L": _("Removed storage volume '%(ident)s' from pool '%(pool)s'"),
+ "KCHVOL0003L": _("Updated storage volume '%(ident)s' at pool '%(pool)s'"),
+ "KCHVOL0004L": _("Wiped storage volume '%(ident)s' off pool '%(pool)s'"),
+ "KCHVOL0005L": _("Resized storage volume '%(ident)s' at pool '%(pool)s' with size %(size)s"),
+ "KCHVOL0006L": _("Cloned storage volume '%(ident)s' at pool '%(pool)s'"),
}
--
1.9.1
8 years, 7 months
[PATCH] [Kimchi 1/2] Add translation to user log messages
by Lucio Correia
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
---
control/networks.py | 10 +++++-----
control/storagepools.py | 10 +++++-----
control/storagevolumes.py | 14 ++++++--------
control/templates.py | 8 ++++----
control/vm/hostdevs.py | 4 ++--
control/vm/ifaces.py | 6 +++---
control/vm/snapshots.py | 6 +++---
control/vm/storages.py | 6 +++---
control/vms.py | 26 +++++++++++++-------------
i18n.py | 45 +++++++++++++++++++++++++++++++++++++++++++++
10 files changed, 89 insertions(+), 46 deletions(-)
diff --git a/control/networks.py b/control/networks.py
index c87b5a6..4b18638 100644
--- a/control/networks.py
+++ b/control/networks.py
@@ -22,15 +22,15 @@ from wok.control.utils import UrlSubNode
NETWORKS_REQUESTS = {
- 'POST': {'default': "Create %(connection)s virtual network '%(name)s'"},
+ 'POST': {'default': "KCHNET0001L"},
}
NETWORK_REQUESTS = {
- 'DELETE': {'default': "Remove virtual network '%(ident)s'"},
- 'PUT': {'default': "Update virtual network '%(ident)s'"},
+ 'DELETE': {'default': "KCHNET0002L"},
+ 'PUT': {'default': "KCHNET0003L"},
'POST': {
- 'activate': "Activate virtual network '%(ident)s'",
- 'deactivate': "Deactivate virtual network '%(ident)s'",
+ 'activate': "KCHNET0004L",
+ 'deactivate': "KCHNET0005L",
},
}
diff --git a/control/storagepools.py b/control/storagepools.py
index 714f4bb..2f25746 100644
--- a/control/storagepools.py
+++ b/control/storagepools.py
@@ -30,15 +30,15 @@ from wok.plugins.kimchi.model.storagepools import ISO_POOL_NAME
STORAGEPOOLS_REQUESTS = {
- 'POST': {'default': "Create %(type)s storage pool '%(name)s'"},
+ 'POST': {'default': "KCHPOOL0001L"},
}
STORAGEPOOL_REQUESTS = {
- 'DELETE': {'default': "Remove storage pool '%(ident)s'"},
- 'PUT': {'default': "Update storage pool '%(ident)s'"},
+ 'DELETE': {'default': "KCHPOOL0002L"},
+ 'PUT': {'default': "KCHPOOL0003L"},
'POST': {
- 'activate': "Activate storage pool '%(ident)s'",
- 'deactivate': "Deactivate storage pool '%(ident)s'",
+ 'activate': "KCHPOOL0004L",
+ 'deactivate': "KCHPOOL0005L",
},
}
diff --git a/control/storagevolumes.py b/control/storagevolumes.py
index a04ad35..351e4bd 100644
--- a/control/storagevolumes.py
+++ b/control/storagevolumes.py
@@ -23,18 +23,16 @@ from wok.control.utils import get_class_name, model_fn
STORAGEVOLUMES_REQUESTS = {
- 'POST': {'default': "Create storage volume '%(name)s' at pool '%(pool)s'"},
+ 'POST': {'default': "KCHVOL0001L"},
}
STORAGEVOLUME_REQUESTS = {
- 'DELETE': {'default': "Remove storage volume '%(ident)s' from "
- "pool '%(pool)s'"},
- 'PUT': {'default': "Update storage volume '%(ident)s' at pool '%(pool)s'"},
+ 'DELETE': {'default': "KCHVOL0002L"},
+ 'PUT': {'default': "KCHVOL0003L"},
'POST': {
- 'wipe': "Wipe storage volume '%(ident)s' off pool '%(pool)s'",
- 'resize': "Resize storage volume '%(ident)s' at pool '%(pool)s' with "
- "size %(size)s",
- 'clone': "Clone storage volume '%(ident)s' at pool '%(pool)s'",
+ 'wipe': "KCHVOL0004L",
+ 'resize': "KCHVOL0005L",
+ 'clone': "KCHVOL0006L",
},
}
diff --git a/control/templates.py b/control/templates.py
index 343ced1..82697d0 100644
--- a/control/templates.py
+++ b/control/templates.py
@@ -22,14 +22,14 @@ from wok.control.utils import UrlSubNode
TEMPLATES_REQUESTS = {
- 'POST': {'default': "Create template '%(name)s'"},
+ 'POST': {'default': "KCHTMPL0001L"},
}
TEMPLATE_REQUESTS = {
- 'DELETE': {'default': "Remove template '%(ident)s'"},
- 'PUT': {'default': "Update template '%(ident)s'"},
+ 'DELETE': {'default': "KCHTMPL0002L"},
+ 'PUT': {'default': "KCHTMPL0003L"},
'POST': {
- 'clone': "Clone template '%(ident)s'",
+ 'clone': "KCHTMPL0004L",
},
}
diff --git a/control/vm/hostdevs.py b/control/vm/hostdevs.py
index e9fd5dc..d21e19d 100644
--- a/control/vm/hostdevs.py
+++ b/control/vm/hostdevs.py
@@ -22,12 +22,12 @@ from wok.control.utils import UrlSubNode
VMHOSTDEVS_REQUESTS = {
- 'POST': {'default': "Attach host device '%(name)s' to guest '%(vmid)s'"},
+ 'POST': {'default': "KCHVMHDEV0001L"},
}
VMHOSTDEV_REQUESTS = {
'DELETE': {
- 'default': "Detach host device '%(ident)s' from guest '%(vmid)s'",
+ 'default': "KCHVMHDEV0002L",
},
}
diff --git a/control/vm/ifaces.py b/control/vm/ifaces.py
index 9ecfc8f..0cea8b5 100644
--- a/control/vm/ifaces.py
+++ b/control/vm/ifaces.py
@@ -23,16 +23,16 @@ from wok.control.utils import UrlSubNode
VMIFACES_REQUESTS = {
'POST': {
- 'default': "Attach network interface '%(network)s' to guest '%(vm)s'",
+ 'default': "KCHVMIF0001L",
},
}
VMIFACE_REQUESTS = {
'DELETE': {
- 'default': "Detach network interface '%(ident)s' from guest '%(vm)s'",
+ 'default': "KCHVMIF0002L",
},
'PUT': {
- 'default': "Update network interface '%(ident)s' at guest '%(vm)s'",
+ 'default': "KCHVMIF0003L",
},
}
diff --git a/control/vm/snapshots.py b/control/vm/snapshots.py
index d8cccc1..20f07a7 100644
--- a/control/vm/snapshots.py
+++ b/control/vm/snapshots.py
@@ -22,13 +22,13 @@ from wok.control.utils import UrlSubNode
VMSNAPSHOTS_REQUESTS = {
- 'POST': {'default': "Create snapshot '%(name)s' at guest '%(vm)s'"},
+ 'POST': {'default': "KCHSNAP0001L"},
}
VMSNAPSHOT_REQUESTS = {
- 'DELETE': {'default': "Remove snapshot '%(ident)s' from guest '%(vm)s'"},
+ 'DELETE': {'default': "KCHSNAP0002L"},
'POST': {
- 'revert': "Revert guest '%(vm)s' to snapshot '%(ident)s'",
+ 'revert': "KCHSNAP0003L",
},
}
diff --git a/control/vm/storages.py b/control/vm/storages.py
index 4a4c8d2..615074a 100644
--- a/control/vm/storages.py
+++ b/control/vm/storages.py
@@ -23,13 +23,13 @@ from wok.control.utils import UrlSubNode
VMSTORAGES_REQUESTS = {
'POST': {
- 'default': "Attach %(type)s storage '%(path)s' to guest '%(vm)s'",
+ 'default': "KCHVMSTOR0001L",
},
}
VMSTORAGE_REQUESTS = {
- 'DELETE': {'default': "Remove storage '%(ident)s' from guest '%(vm)s'"},
- 'PUT': {'default': "Update storage '%(ident)s' at guest '%(vm)s'"},
+ 'DELETE': {'default': "KCHVMSTOR0002L"},
+ 'PUT': {'default': "KCHVMSTOR0003L"},
}
diff --git a/control/vms.py b/control/vms.py
index 64df00e..2339017 100644
--- a/control/vms.py
+++ b/control/vms.py
@@ -25,24 +25,24 @@ from wok.plugins.kimchi.control.vm import sub_nodes
VMS_REQUESTS = {
'POST': {
- 'default': "Create guest '%(name)s' from template '%(template)s'",
+ 'default': "KCHVM0001L",
},
}
VM_REQUESTS = {
- 'DELETE': {'default': "Remove guest '%(ident)s'"},
- 'PUT': {'default': "Edit guest '%(ident)s'"},
+ 'DELETE': {'default': "KCHVM0002L"},
+ 'PUT': {'default': "KCHVM0003L"},
'POST': {
- 'start': "Start guest '%(ident)s'",
- 'poweroff': "Power off guest '%(ident)s'",
- 'shutdown': "Shutdown guest '%(ident)s'",
- 'reset': "Restart guest '%(ident)s'",
- 'connect': "Connect to guest '%(ident)s' through novnc/spice",
- 'clone': "Clone guest '%(ident)s'",
- 'migrate': "Migrate guest '%(ident)s' to '%(remote_host)s'",
- 'suspend': "Suspend guest '%(ident)s'",
- 'resume': "Resume guest '%(ident)s'",
- 'serial': "Connect to guest '%(ident)s' through serial",
+ 'start': "KCHVM0004L",
+ 'poweroff': "KCHVM0005L",
+ 'shutdown': "KCHVM0006L",
+ 'reset': "KCHVM0007L",
+ 'connect': "KCHVM0008L",
+ 'clone': "KCHVM0009L",
+ 'migrate': "KCHVM0010L",
+ 'suspend': "KCHVM0011L",
+ 'resume': "KCHVM0012L",
+ 'serial': "KCHVM0013L",
},
}
diff --git a/i18n.py b/i18n.py
index db245c0..7baa3b6 100644
--- a/i18n.py
+++ b/i18n.py
@@ -331,4 +331,49 @@ messages = {
"KCHLVMS0001E": _("Invalid volume group name parameter: %(name)s."),
+ # These messages (ending with L) are for user log purposes
+ "KCHNET0001L": _("Create %(connection)s virtual network '%(name)s'"),
+ "KCHNET0002L": _("Remove virtual network '%(ident)s'"),
+ "KCHNET0003L": _("Update virtual network '%(ident)s'"),
+ "KCHNET0004L": _("Activate virtual network '%(ident)s'"),
+ "KCHNET0005L": _("Deactivate virtual network '%(ident)s'"),
+ "KCHPOOL0001L": _("Create %(type)s storage pool '%(name)s'"),
+ "KCHPOOL0002L": _("Remove storage pool '%(ident)s'"),
+ "KCHPOOL0003L": _("Update storage pool '%(ident)s'"),
+ "KCHPOOL0004L": _("Activate storage pool '%(ident)s'"),
+ "KCHPOOL0005L": _("Deactivate storage pool '%(ident)s'"),
+ "KCHSNAP0001L": _("Create snapshot '%(name)s' at guest '%(vm)s'"),
+ "KCHSNAP0002L": _("Remove snapshot '%(ident)s' from guest '%(vm)s'"),
+ "KCHSNAP0003L": _("Revert guest '%(vm)s' to snapshot '%(ident)s'"),
+ "KCHTMPL0001L": _("Create template '%(name)s'"),
+ "KCHTMPL0002L": _("Remove template '%(ident)s'"),
+ "KCHTMPL0003L": _("Update template '%(ident)s'"),
+ "KCHTMPL0004L": _("Clone template '%(ident)s'"),
+ "KCHVM0001L": _("Create guest '%(name)s' from template '%(template)s'"),
+ "KCHVM0002L": _("Remove guest '%(ident)s'"),
+ "KCHVM0003L": _("Edit guest '%(ident)s'"),
+ "KCHVM0004L": _("Start guest '%(ident)s'"),
+ "KCHVM0005L": _("Power off guest '%(ident)s'"),
+ "KCHVM0006L": _("Shutdown guest '%(ident)s'"),
+ "KCHVM0007L": _("Restart guest '%(ident)s'"),
+ "KCHVM0008L": _("Connect to guest '%(ident)s' through novnc/spice"),
+ "KCHVM0009L": _("Clone guest '%(ident)s'"),
+ "KCHVM0010L": _("Migrate guest '%(ident)s' to '%(remote_host)s'"),
+ "KCHVM0011L": _("Suspend guest '%(ident)s'"),
+ "KCHVM0012L": _("Resume guest '%(ident)s'"),
+ "KCHVM0013L": _("Connect to guest '%(ident)s' through serial"),
+ "KCHVMHDEV0001L": _("Attach host device '%(name)s' to guest '%(vmid)s'"),
+ "KCHVMHDEV0002L": _("Detach host device '%(ident)s' from guest '%(vmid)s'"),
+ "KCHVMIF0001L": _("Attach network interface '%(network)s' to guest '%(vm)s'"),
+ "KCHVMIF0002L": _("Detach network interface '%(ident)s' from guest '%(vm)s'"),
+ "KCHVMIF0003L": _("Update network interface '%(ident)s' at guest '%(vm)s'"),
+ "KCHVMSTOR0001L": _("Attach %(type)s storage '%(path)s' to guest '%(vm)s'"),
+ "KCHVMSTOR0002L": _("Remove storage '%(ident)s' from guest '%(vm)s'"),
+ "KCHVMSTOR0003L": _("Update storage '%(ident)s' at guest '%(vm)s'"),
+ "KCHVOL0001L": _("Create storage volume '%(name)s' at pool '%(pool)s'"),
+ "KCHVOL0002L": _("Remove storage volume '%(ident)s' from pool '%(pool)s'"),
+ "KCHVOL0003L": _("Update storage volume '%(ident)s' at pool '%(pool)s'"),
+ "KCHVOL0004L": _("Wipe storage volume '%(ident)s' off pool '%(pool)s'"),
+ "KCHVOL0005L": _("Resize storage volume '%(ident)s' at pool '%(pool)s' with size %(size)s"),
+ "KCHVOL0006L": _("Clone storage volume '%(ident)s' at pool '%(pool)s'"),
}
--
1.9.1
8 years, 7 months
[PATCH] [Kimchi 0/2] Add translation support to user log
by Lucio Correia
Lucio Correia (2):
Add translation to user log messages
Use verbs in the past
control/networks.py | 10 +++++-----
control/storagepools.py | 10 +++++-----
control/storagevolumes.py | 14 ++++++--------
control/templates.py | 8 ++++----
control/vm/hostdevs.py | 4 ++--
control/vm/ifaces.py | 6 +++---
control/vm/snapshots.py | 6 +++---
control/vm/storages.py | 6 +++---
control/vms.py | 26 +++++++++++++-------------
i18n.py | 45 +++++++++++++++++++++++++++++++++++++++++++++
10 files changed, 89 insertions(+), 46 deletions(-)
--
1.9.1
8 years, 7 months
[PATCH] [Wok 3/3] Use past verbs
by Lucio Correia
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
---
src/wok/i18n.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/wok/i18n.py b/src/wok/i18n.py
index d3342fc..4fc21f1 100644
--- a/src/wok/i18n.py
+++ b/src/wok/i18n.py
@@ -56,8 +56,8 @@ messages = {
"WOKUTILS0005E": _("Invalid data unit '%(unit)s'"),
# These messages (ending with L) are for user log purposes
- "WOKCOL0001L": _("Request on collection"),
- "WOKRES0001L": _("Request on resource"),
- "WOKROOT0001L": _("User '%(username)s' login"),
- "WOKROOT0002L": _("User '%(username)s' logout"),
+ "WOKCOL0001L": _("Request made on collection"),
+ "WOKRES0001L": _("Request made on resource"),
+ "WOKROOT0001L": _("User '%(username)s' logged in"),
+ "WOKROOT0002L": _("User '%(username)s' logged out"),
}
--
1.9.1
8 years, 7 months
[PATCH] [Wok 2/3] Add support and translate user request log messages
by Lucio Correia
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
---
src/wok/control/base.py | 17 ++++++++++++-----
src/wok/i18n.py | 6 ++++++
src/wok/root.py | 13 +++++++++----
3 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/src/wok/control/base.py b/src/wok/control/base.py
index 29b43ac..be5f618 100644
--- a/src/wok/control/base.py
+++ b/src/wok/control/base.py
@@ -33,13 +33,14 @@ from wok.control.utils import validate_params
from wok.exception import InvalidOperation, InvalidParameter
from wok.exception import MissingParameter, NotFoundError
from wok.exception import OperationFailed, UnauthorizedError, WokException
+from wok.message import WokMessage
from wok.reqlogger import RequestRecord
from wok.utils import get_plugin_from_request, utf8_dict, wok_log
# Default request log messages
-COLLECTION_DEFAULT_LOG = "request on collection"
-RESOURCE_DEFAULT_LOG = "request on resource"
+COLLECTION_DEFAULT_LOG = "WOKCOL0001L"
+RESOURCE_DEFAULT_LOG = "WOKRES0001L"
LOG_DISABLED_METHODS = ['GET']
@@ -138,9 +139,11 @@ class Resource(object):
action_result = action_fn(*model_args)
# log request
+ code = self.getRequestMessage(method, action_name)
reqParams = utf8_dict(self.log_args, request)
+ msg = WokMessage(code, reqParams).get_text(prepend_code=False)
RequestRecord(
- self.getRequestMessage(method, action_name) % reqParams,
+ msg,
app=get_plugin_from_request(),
req=method,
user=cherrypy.session.get(USER_NAME, 'N/A')
@@ -218,8 +221,10 @@ class Resource(object):
# log request
if method not in LOG_DISABLED_METHODS:
+ code = self.getRequestMessage(method)
+ msg = WokMessage(code, self.log_args).get_text(prepend_code=False)
RequestRecord(
- self.getRequestMessage(method) % self.log_args,
+ msg,
app=get_plugin_from_request(),
req=method,
user=cherrypy.session.get(USER_NAME, 'N/A')
@@ -437,9 +442,11 @@ class Collection(object):
result = self.create(params, *args)
# log request
+ code = self.getRequestMessage(method)
reqParams = utf8_dict(self.log_args, params)
+ msg = WokMessage(code, reqParams).get_text(prepend_code=False)
RequestRecord(
- self.getRequestMessage(method) % reqParams,
+ msg,
app=get_plugin_from_request(),
req=method,
user=cherrypy.session.get(USER_NAME, 'N/A')
diff --git a/src/wok/i18n.py b/src/wok/i18n.py
index 5a2876f..d3342fc 100644
--- a/src/wok/i18n.py
+++ b/src/wok/i18n.py
@@ -54,4 +54,10 @@ messages = {
"WOKUTILS0002E": _("Timeout while running command '%(cmd)s' after %(seconds)s seconds"),
"WOKUTILS0004E": _("Invalid data value '%(value)s'"),
"WOKUTILS0005E": _("Invalid data unit '%(unit)s'"),
+
+ # These messages (ending with L) are for user log purposes
+ "WOKCOL0001L": _("Request on collection"),
+ "WOKRES0001L": _("Request on resource"),
+ "WOKROOT0001L": _("User '%(username)s' login"),
+ "WOKROOT0002L": _("User '%(username)s' logout"),
}
diff --git a/src/wok/root.py b/src/wok/root.py
index d1a2cc9..29ea657 100644
--- a/src/wok/root.py
+++ b/src/wok/root.py
@@ -32,14 +32,15 @@ from wok.control import sub_nodes
from wok.control.base import Resource
from wok.control.utils import parse_request
from wok.exception import MissingParameter, OperationFailed
+from wok.message import WokMessage
from wok.reqlogger import RequestRecord
from wok.utils import get_plugin_from_request
ROOT_REQUESTS = {
'POST': {
- 'login': "User '%(username)s' login",
- 'logout': "User '%(username)s' logout",
+ 'login': "WOKROOT0001L",
+ 'logout': "WOKROOT0002L",
},
}
@@ -165,8 +166,10 @@ class WokRoot(Root):
raise cherrypy.HTTPError(401)
finally:
method = 'POST'
+ code = self.getRequestMessage(method, 'login')
+ msg = WokMessage(code, params).get_text(prepend_code=False)
RequestRecord(
- self.getRequestMessage(method, 'login') % params,
+ msg,
app=get_plugin_from_request(),
req=method,
user=cherrypy.session.get(auth.USER_NAME, 'N/A')
@@ -177,9 +180,11 @@ class WokRoot(Root):
@cherrypy.expose
def logout(self):
method = 'POST'
+ code = self.getRequestMessage(method, 'logout')
params = {'username': cherrypy.session.get(auth.USER_NAME, 'N/A')}
+ msg = WokMessage(code, params).get_text(prepend_code=False)
RequestRecord(
- self.getRequestMessage(method, 'logout') % params,
+ msg,
app=get_plugin_from_request(),
req=method,
user=params['username']
--
1.9.1
8 years, 7 months