[PATCH v2] [Kimchi] Issue #948: Kimchi not throwing errors when migration is performed and gives impression of migration doesn't work
by sguimaraes943@gmail.com
From: Samuel Guimarães <sguimaraes943(a)gmail.com>
This patch fixes an issue related to error messages not being captured by failed live migration tasks.
This requires Wok patch for issue #79 otherwise it will repeat error messages once the guests list is refreshed.
v2:
- Removed function from kimchi.guest_main.js and inserted error message on kimchi.trackTask error callback.
Samuel Guimarães (1):
Issue #948: Kimchi not throwing errors when migration is performed and gives impression of migration doesn't work
ui/js/src/kimchi.guest_livemigration.js | 9 +++++----
ui/js/src/kimchi.guest_main.js | 5 ++---
2 files changed, 7 insertions(+), 7 deletions(-)
--
1.8.3.1
8 years, 5 months
[PATCH v2] [Wok] Adding DataTables.net plugin and Moment.js to Wok
by sguimaraes943@gmail.com
From: Samuel Guimarães <sguimaraes943(a)gmail.com>
Some files are minified. Let me know if they were corrupted by git send-email --no-validate
This commit adds DataTables.net jQuery plugin and Moment.js library to Wok.
DataTables.net is a table plugin that supports pagination, instance search and multi-column ordering. It also has a responsive module and it is compatible with many different CSS libraries.
In this commit it is included a customization for its Bootstrap integration and a default initialization script pre-loaded with Wok styles.
Moment.js is a lightweight JavaScript date library for parsing, validating, manipulating, and formatting dates. It is required in order to filter and sort dates properly in Wok User Logs and Ginger Configuration Backup.
v2 - Added minified files that were ignored by .gitignore
Samuel Guimarães (1):
Adding DataTables.net plugin and Moment.js to Wok
configure.ac | 3 +
ui/css/Makefile.am | 8 +-
ui/css/datatables.bootstrap.css | 243 +++++++++++++++++++++
ui/css/src/datatables.bootstrap.scss | 289 +++++++++++++++++++++++++
ui/js/src/wok.datatables.js | 26 +++
ui/libs/Makefile.am | 2 +-
ui/libs/datatables/Makefile.am | 23 ++
ui/libs/datatables/css/Makefile.am | 21 ++
ui/libs/datatables/css/datatables.min.css | 15 ++
ui/libs/datatables/datatables.bootstrap.min.js | 8 +
ui/libs/datatables/datatables.min.js | 190 ++++++++++++++++
ui/libs/moment/LICENSE | 22 ++
ui/libs/moment/Makefile.am | 21 ++
ui/libs/moment/moment-with-locales.min.js | 76 +++++++
ui/pages/login.html.tmpl | 5 +
ui/pages/wok-ui.html.tmpl | 5 +
16 files changed, 954 insertions(+), 3 deletions(-)
create mode 100644 ui/css/datatables.bootstrap.css
create mode 100644 ui/css/src/datatables.bootstrap.scss
create mode 100644 ui/js/src/wok.datatables.js
create mode 100644 ui/libs/datatables/Makefile.am
create mode 100644 ui/libs/datatables/css/Makefile.am
create mode 100644 ui/libs/datatables/css/datatables.min.css
create mode 100644 ui/libs/datatables/datatables.bootstrap.min.js
create mode 100644 ui/libs/datatables/datatables.min.js
create mode 100644 ui/libs/moment/LICENSE
create mode 100644 ui/libs/moment/Makefile.am
create mode 100644 ui/libs/moment/moment-with-locales.min.js
--
1.9.3
8 years, 5 months
[PATCH] [Kimchi] Make sure all log messages have required parameters
by Lucio Correia
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
---
control/networks.py | 3 +++
control/storagepools.py | 3 +++
control/storagevolumes.py | 3 +++
control/templates.py | 3 +++
control/vm/hostdevs.py | 5 +++++
control/vm/ifaces.py | 4 ++++
control/vm/snapshots.py | 4 ++++
control/vm/storages.py | 5 +++++
control/vms.py | 5 +++++
i18n.py | 4 ++--
10 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/control/networks.py b/control/networks.py
index 4b18638..1b8012e 100644
--- a/control/networks.py
+++ b/control/networks.py
@@ -42,7 +42,10 @@ class Networks(Collection):
self.role_key = 'network'
self.admin_methods = ['POST']
self.resource = Network
+
+ # set user log messages and make sure all parameters are present
self.log_map = NETWORKS_REQUESTS
+ self.log_args.update({'connection': '', 'name': ''})
class Network(Resource):
diff --git a/control/storagepools.py b/control/storagepools.py
index 2f25746..e188aae 100644
--- a/control/storagepools.py
+++ b/control/storagepools.py
@@ -52,7 +52,10 @@ class StoragePools(Collection):
self.resource = StoragePool
isos = IsoPool(model)
setattr(self, ISO_POOL_NAME, isos)
+
+ # set user log messages and make sure all parameters are present
self.log_map = STORAGEPOOLS_REQUESTS
+ self.log_args.update({'name': '', 'type': ''})
def create(self, params, *args):
try:
diff --git a/control/storagevolumes.py b/control/storagevolumes.py
index c121b5e..a27396f 100644
--- a/control/storagevolumes.py
+++ b/control/storagevolumes.py
@@ -68,9 +68,12 @@ class StorageVolume(Resource):
self.resize = self.generate_action_handler('resize', ['size'])
self.wipe = self.generate_action_handler('wipe')
self.clone = self.generate_action_handler_task('clone')
+
+ # set user log messages and make sure all parameters are present
self.log_map = STORAGEVOLUME_REQUESTS
self.log_args.update({
'pool': self.pool.encode('utf-8') if self.pool else '',
+ 'size': '',
})
@property
diff --git a/control/templates.py b/control/templates.py
index 82697d0..bb2e068 100644
--- a/control/templates.py
+++ b/control/templates.py
@@ -41,7 +41,10 @@ class Templates(Collection):
self.role_key = 'templates'
self.admin_methods = ['GET', 'POST']
self.resource = Template
+
+ # set user log messages and make sure all parameters are present
self.log_map = TEMPLATES_REQUESTS
+ self.log_args.update({'name': ''})
class Template(Resource):
diff --git a/control/vm/hostdevs.py b/control/vm/hostdevs.py
index d21e19d..c39d7fb 100644
--- a/control/vm/hostdevs.py
+++ b/control/vm/hostdevs.py
@@ -40,8 +40,11 @@ class VMHostDevs(AsyncCollection):
self.vmid = vmid
self.resource_args = [self.vmid, ]
self.model_args = [self.vmid, ]
+
+ # set user log messages and make sure all parameters are present
self.log_map = VMHOSTDEVS_REQUESTS
self.log_args.update({
+ 'name': '',
'vmid': self.vmid.encode('utf-8') if self.vmid else '',
})
@@ -52,6 +55,8 @@ class VMHostDev(AsyncResource):
self.vmid = vmid
self.ident = ident
self.model_args = [self.vmid, self.ident]
+
+ # set user log messages and make sure all parameters are present
self.log_map = VMHOSTDEV_REQUESTS
self.log_args.update({
'vmid': self.vmid.encode('utf-8') if self.vmid else '',
diff --git a/control/vm/ifaces.py b/control/vm/ifaces.py
index 7e133a6..cd9bd31 100644
--- a/control/vm/ifaces.py
+++ b/control/vm/ifaces.py
@@ -45,6 +45,8 @@ class VMIfaces(Collection):
self.vm = vm
self.resource_args = [self.vm, ]
self.model_args = [self.vm, ]
+
+ # set user log messages and make sure all parameters are present
self.log_map = VMIFACES_REQUESTS
self.log_args.update({
'network': '',
@@ -60,6 +62,8 @@ class VMIface(Resource):
self.info = {}
self.model_args = [self.vm, self.ident]
self.uri_fmt = '/vms/%s/ifaces/%s'
+
+ # set user log messages and make sure all parameters are present
self.log_map = VMIFACE_REQUESTS
self.log_args.update({
'vm': self.vm.encode('utf-8') if self.vm else '',
diff --git a/control/vm/snapshots.py b/control/vm/snapshots.py
index 20f07a7..d66fa06 100644
--- a/control/vm/snapshots.py
+++ b/control/vm/snapshots.py
@@ -42,6 +42,8 @@ class VMSnapshots(AsyncCollection):
self.resource_args = [self.vm, ]
self.model_args = [self.vm, ]
self.current = CurrentVMSnapshot(model, vm)
+
+ # set user log messages and make sure all parameters are present
self.log_map = VMSNAPSHOTS_REQUESTS
self.log_args.update({
'vm': self.vm.encode('utf-8') if self.vm else '',
@@ -57,6 +59,8 @@ class VMSnapshot(Resource):
self.model_args = [self.vm, self.ident]
self.uri_fmt = '/vms/%s/snapshots/%s'
self.revert = self.generate_action_handler('revert')
+
+ # set user log messages and make sure all parameters are present
self.log_map = VMSNAPSHOT_REQUESTS
self.log_args.update({
'vm': self.vm.encode('utf-8') if self.vm else '',
diff --git a/control/vm/storages.py b/control/vm/storages.py
index 615074a..5ef5f1a 100644
--- a/control/vm/storages.py
+++ b/control/vm/storages.py
@@ -41,10 +41,13 @@ class VMStorages(Collection):
self.vm = vm
self.resource_args = [self.vm, ]
self.model_args = [self.vm, ]
+
+ # set user log messages and make sure all parameters are present
self.log_map = VMSTORAGES_REQUESTS
self.log_args.update({
'vm': self.vm.encode('utf-8') if self.vm else '',
'path': '',
+ 'type': '',
})
@@ -56,6 +59,8 @@ class VMStorage(Resource):
self.info = {}
self.model_args = [self.vm, self.ident]
self.uri_fmt = '/vms/%s/storages/%s'
+
+ # set user log messages and make sure all parameters are present
self.log_map = VMSTORAGE_REQUESTS
self.log_args.update({
'vm': self.vm.encode('utf-8') if self.vm else '',
diff --git a/control/vms.py b/control/vms.py
index b351c72..bbf0fa4 100644
--- a/control/vms.py
+++ b/control/vms.py
@@ -54,6 +54,8 @@ class VMs(AsyncCollection):
self.resource = VM
self.role_key = 'guests'
self.admin_methods = ['POST']
+
+ # set user log messages and make sure all parameters are present
self.log_map = VMS_REQUESTS
self.log_args.update({'name': '', 'template': ''})
@@ -82,7 +84,10 @@ class VM(Resource):
self.suspend = self.generate_action_handler('suspend')
self.resume = self.generate_action_handler('resume')
self.serial = self.generate_action_handler('serial')
+
+ # set user log messages and make sure all parameters are present
self.log_map = VM_REQUESTS
+ self.log_args.update({'remote_host': ''})
@property
def data(self):
diff --git a/i18n.py b/i18n.py
index b33c6ec..08a3ac8 100644
--- a/i18n.py
+++ b/i18n.py
@@ -339,12 +339,12 @@ messages = {
"KCHEVENT0004W": _("I/O error on guest '%(vm)s': storage pool out of space for %(devAlias)s (%(srcPath)s)."),
# These messages (ending with L) are for user log purposes
- "KCHNET0001L": _("Created %(connection)s virtual network '%(name)s'"),
+ "KCHNET0001L": _("Created virtual network '%(name)s' type '%(connection)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'"),
+ "KCHPOOL0001L": _("Created storage pool '%(name)s' type '%(type)s'"),
"KCHPOOL0002L": _("Removed storage pool '%(ident)s'"),
"KCHPOOL0003L": _("Updated storage pool '%(ident)s'"),
"KCHPOOL0004L": _("Activated storage pool '%(ident)s'"),
--
1.9.1
8 years, 5 months
[PATCH] [Kimchi] VM migrate: generic remote path check
by dhbarboza82@gmail.com
From: Daniel Henrique Barboza <danielhb(a)linux.vnet.ibm.com>
The method _check_if_path_exists_in_remote_host was using
'test -f' to check if a file exist in the remote host.
Hovewer, when using iSCSI disks, this path is a symlink
instead of a regular file. This results in failure, making
the code wrongly go to the 'non-shared' migration scenario.
This patch changes the 'test' flag to '-e', which will simply
check for the existence of the path in the remote host. There
is no need to distinguish between whether the path is a file
or a symlink in this method - we just want to know if the path
is valid in the remote host.
Signed-off-by: Daniel Henrique Barboza <danielhb(a)linux.vnet.ibm.com>
---
model/vms.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/model/vms.py b/model/vms.py
index 3b08c10..7745027 100644
--- a/model/vms.py
+++ b/model/vms.py
@@ -1731,7 +1731,7 @@ class VMModel(object):
def _check_if_path_exists_in_remote_host(self, path, remote_host, user):
username_host = "%s@%s" % ('root', remote_host)
cmd = ['ssh', '-oStrictHostKeyChecking=no', username_host,
- 'test', '-f', path]
+ 'test', '-e', path]
_, _, returncode = run_command(cmd, 5, silent=True)
return returncode == 0
--
2.5.5
8 years, 5 months
[PATCH v2][Kimchi] Avoid break Wok when register events, if Libvirt is down
by Rodrigo Trujillo
When Wok starts up it loads Kimcho model, which tries to register
Libvirt events. A problem happens if Libvirt service is down when Wok
starts (usually manually/command line start up), because the connection
is None, raising an error that breaks Wok.
This patch fixes this problem and return a proper log message.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
model/libvirtevents.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/model/libvirtevents.py b/model/libvirtevents.py
index 632d399..dfd22c6 100644
--- a/model/libvirtevents.py
+++ b/model/libvirtevents.py
@@ -83,5 +83,9 @@ class LibvirtEvents(object):
self.event_enospc_cb,
libvirt.VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON
)
- except libvirt.libvirtError as e:
- wok_log.error("Register of ENOSPC event failed: %s" % e.message)
+ except (libvirt.libvirtError, AttributeError) as e:
+ if type(e) == AttributeError:
+ reason = 'Libvirt service is not running'
+ else:
+ reason = e.message
+ wok_log.error("Register of ENOSPC event failed: %s" % reason)
--
2.1.0
8 years, 5 months
[PATCH] [Wok] Fix PEP8 issue
by Lucio Correia
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
---
src/wok/server.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/wok/server.py b/src/wok/server.py
index 567364d..8a02596 100644
--- a/src/wok/server.py
+++ b/src/wok/server.py
@@ -152,10 +152,10 @@ class Server(object):
# redefine logrotate configuration according to wok.conf
data = Template(LOGROTATE_TEMPLATE)
- data = data.safe_substitute(log_dir=configParser.get("logging",
- "log_dir"),
- log_size=configParser.get("logging",
- "log_size"))
+ data = data.safe_substitute(
+ log_dir=configParser.get("logging", "log_dir"),
+ log_size=configParser.get("logging", "log_size")
+ )
# Write file to be used for nginx.
config_file = open(os.path.join(paths.logrotate_dir, "wokd"), "w")
--
1.9.1
8 years, 5 months
[PATCH ][Wok] Issue #116:No indication of debug reports being generated(Gingerbase)
by atreyee@linux.vnet.ibm.com
From: Atreyee Mukhopadhyay <atreyee(a)linux.vnet.ibm.com>
pending reports are masked with 'generating..' message which was
not getting parsed by locale datetime converter.invalid date message
was shown and pending report was not disabled for operations.
---
ui/js/src/wok.utils.js | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/ui/js/src/wok.utils.js b/ui/js/src/wok.utils.js
index 54f8cf0..afe4020 100644
--- a/ui/js/src/wok.utils.js
+++ b/ui/js/src/wok.utils.js
@@ -232,9 +232,14 @@ wok.notificationsLoop = function notificationsLoop() {
}
wok.datetimeLocaleConverter = function datetimeLocaleConverter(datetime_string, locale){
- var dte = new Date(datetime_string.substr(0,10) + 'T' + datetime_string.substr(11));
- var options = { year: 'numeric', month: 'long', day: 'numeric' };
- return dte.toLocaleString(locale, options);
+ var dateRegEx = /(\d{4})-(\d{2})-(\d{2})/;
+ if(dateRegEx.test(datetime_string.substr(0,10))){
+ var dte = new Date(datetime_string.substr(0,10) + 'T' + datetime_string.substr(11));
+ var options = { year: 'numeric', month: 'long', day: 'numeric' };
+ return dte.toLocaleString(locale, options);
+ }else{
+ return datetime_string;
+ }
}
wok.dateLocaleConverter = function dateLocaleConverter(date_string, locale){
--
2.1.0
8 years, 5 months
[PATCH] [Wok] Adds DataTables.net plugin and Moment.js to Wok
by sguimaraes943@gmail.com
From: Samuel Guimarães <sguimaraes943(a)gmail.com>
Some files are minified. Let me know if they were corrupted by git send-email --no-validate
This commit adds DataTables.net jQuery plugin and Moment.js library to Wok.
DataTables.net is a table plugin that supports pagination, instance search and multi-column ordering. It also has a responsive module and it is compatible with many different CSS libraries.
In this commit it is included a customization for its Bootstrap integration and a default initialization script pre-loaded with Wok styles.
Moment.js is a lightweight JavaScript date library for parsing, validating, manipulating, and formatting dates. It is required in order to filter and sort dates properly in Wok User Logs and Ginger Configuration Backup.
Samuel Guimarães (1):
Adding DataTables.net plugin and Moment.js to Wok
configure.ac | 3 +
ui/css/Makefile.am | 8 +-
ui/css/datatables.bootstrap.css | 243 +++++++++++++++++++++++++++++
ui/css/src/datatables.bootstrap.scss | 289 +++++++++++++++++++++++++++++++++++
ui/js/src/wok.datatables.js | 26 ++++
ui/libs/Makefile.am | 2 +-
ui/libs/datatables/Makefile.am | 23 +++
ui/libs/datatables/css/Makefile.am | 21 +++
ui/libs/moment/LICENSE | 22 +++
ui/libs/moment/Makefile.am | 21 +++
ui/pages/login.html.tmpl | 5 +
ui/pages/wok-ui.html.tmpl | 5 +
12 files changed, 665 insertions(+), 3 deletions(-)
create mode 100644 ui/css/datatables.bootstrap.css
create mode 100644 ui/css/src/datatables.bootstrap.scss
create mode 100644 ui/js/src/wok.datatables.js
create mode 100644 ui/libs/datatables/Makefile.am
create mode 100644 ui/libs/datatables/css/Makefile.am
create mode 100644 ui/libs/moment/LICENSE
create mode 100644 ui/libs/moment/Makefile.am
--
1.9.3
8 years, 5 months
[PATCH v2] [Wok] Issue #79: All error messages should keep on UI until user dismiss it
by sguimaraes943@gmail.com
From: Samuel Guimarães <sguimaraes943(a)gmail.com>
This commit makes all messages closeable by default, removing the fade animation after 10 seconds.
A parameter to allow a custom ID for each alert was also added to wok.message function.
v2:
- Fixed an issue where some alerts were not dismissible;
- This commit also fixes a bug where alert "close" buttons would close modal windows.
Samuel Guimarães (1):
Issue #79: All error messages should keep on UI until user dismiss it
ui/js/src/wok.message.js | 69 +++++++++++++++++++++++++-----------------------
ui/js/src/wok.window.js | 2 +-
2 files changed, 37 insertions(+), 34 deletions(-)
--
1.8.3.1
8 years, 5 months
[PATCH] [Kimchi] Do not break the logging of failed requests
by Lucio Correia
Now that failed requests are also logged, this fix is
necessary to avoid breaking the logging itself due to
lack of parameters.
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
---
control/storagevolumes.py | 1 +
control/vm/ifaces.py | 1 +
control/vms.py | 2 +-
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/control/storagevolumes.py b/control/storagevolumes.py
index c3f1c29..c121b5e 100644
--- a/control/storagevolumes.py
+++ b/control/storagevolumes.py
@@ -46,6 +46,7 @@ class StorageVolumes(AsyncCollection):
self.model_args = [self.pool, ]
self.log_map = STORAGEVOLUMES_REQUESTS
self.log_args.update({
+ 'name': '',
'pool': self.pool.encode('utf-8') if self.pool else '',
})
diff --git a/control/vm/ifaces.py b/control/vm/ifaces.py
index 0cea8b5..7e133a6 100644
--- a/control/vm/ifaces.py
+++ b/control/vm/ifaces.py
@@ -47,6 +47,7 @@ class VMIfaces(Collection):
self.model_args = [self.vm, ]
self.log_map = VMIFACES_REQUESTS
self.log_args.update({
+ 'network': '',
'vm': self.vm.encode('utf-8') if self.vm else '',
})
diff --git a/control/vms.py b/control/vms.py
index 2339017..b351c72 100644
--- a/control/vms.py
+++ b/control/vms.py
@@ -55,7 +55,7 @@ class VMs(AsyncCollection):
self.role_key = 'guests'
self.admin_methods = ['POST']
self.log_map = VMS_REQUESTS
- self.log_args.update({'name': ''})
+ self.log_args.update({'name': '', 'template': ''})
class VM(Resource):
--
1.9.1
8 years, 5 months