[PATCH] [Kimchi 0/3] Fix issue #1020

Aline Manera (3): Fix issue #1020: Verify libvirt access on real file path instead of symlink Fix issue #1020: Fix alert icon position to do not overlay img/iso icon Bug fix: Disable "Search More ISOs" button on create Template dialog when the operation is in progress model/storagevolumes.py | 3 ++- model/templates.py | 5 +++-- ui/css/kimchi.css | 4 ++-- ui/css/src/modules/_templates.scss | 4 ++-- ui/js/src/kimchi.template_add_main.js | 1 + 5 files changed, 10 insertions(+), 7 deletions(-) -- 2.5.5

While checking libvirt file permission, it must be done on real file path as it can be a symlink and it can impact the results. Signed-off-by: Aline Manera <alinefm@linux.vnet.ibm.com> --- model/storagevolumes.py | 3 ++- model/templates.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/model/storagevolumes.py b/model/storagevolumes.py index a6ce97b..0c710b2 100644 --- a/model/storagevolumes.py +++ b/model/storagevolumes.py @@ -330,7 +330,8 @@ class StorageVolumeModel(object): used_by = get_disk_used_by(self.conn, path) if (self.libvirt_user is None): self.libvirt_user = UserTests().probe_user() - ret, _ = probe_file_permission_as_user(path, self.libvirt_user) + ret, _ = probe_file_permission_as_user(os.path.realpath(path), + self.libvirt_user) res = dict(type=VOLUME_TYPE_MAP[info[0]], capacity=info[1], allocation=info[2], diff --git a/model/templates.py b/model/templates.py index 04e6626..0a6e049 100644 --- a/model/templates.py +++ b/model/templates.py @@ -101,8 +101,9 @@ class TemplatesModel(object): st_mode = os.stat(path).st_mode if stat.S_ISREG(st_mode) or stat.S_ISBLK(st_mode): user = UserTests().probe_user() - run_setfacl_set_attr(path, user=user) - ret, excp = probe_file_permission_as_user(path, user) + realpath = os.path.realpath(path) + run_setfacl_set_attr(realpath, user=user) + ret, excp = probe_file_permission_as_user(realpath, user) if ret is False: raise InvalidParameter('KCHISO0008E', {'filename': path, 'user': user, -- 2.5.5

When libvirt does not have enough permission to access an ISO/Img file, the file is marked as invalid and an alert icon is displayed. Before this patch, the alert icon was overlaying the ISO/Img icon. So fix its position to avoid that. Signed-off-by: Aline Manera <alinefm@linux.vnet.ibm.com> --- ui/css/kimchi.css | 4 ++-- ui/css/src/modules/_templates.scss | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/css/kimchi.css b/ui/css/kimchi.css index 6cf2cc9..7fb235a 100644 --- a/ui/css/kimchi.css +++ b/ui/css/kimchi.css @@ -1763,8 +1763,8 @@ body.wok-gallery { #template-add-window span.iso-image-alert { position: absolute; - bottom: 17px; - right: 45px; + bottom: 15px; + right: 70px; font-size: 20px; } diff --git a/ui/css/src/modules/_templates.scss b/ui/css/src/modules/_templates.scss index a75d803..27df464 100644 --- a/ui/css/src/modules/_templates.scss +++ b/ui/css/src/modules/_templates.scss @@ -297,8 +297,8 @@ $kimchi-icon-path: '../images'; } span.iso-image-alert { position: absolute; - bottom: 17px; - right: 45px; + bottom: 15px; + right: 70px; font-size: 20px; } .tooltip-arrow { -- 2.5.5

After clicking on "Search More ISOs", the button kept enabled, so user can click it again and again. So disable the button, when the operation is in progress to avoid multiple requests for the same thing. Signed-off-by: Aline Manera <alinefm@linux.vnet.ibm.com> --- ui/js/src/kimchi.template_add_main.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/js/src/kimchi.template_add_main.js b/ui/js/src/kimchi.template_add_main.js index aa76fcc..ebb5c12 100644 --- a/ui/js/src/kimchi.template_add_main.js +++ b/ui/js/src/kimchi.template_add_main.js @@ -213,6 +213,7 @@ kimchi.template_add_main = function() { wok.confirm(settings, function() { $('#iso-more').hide(); $('#iso-more-loading').show(); + $('#iso-more-loading').attr('disabled', 'disabled'); deepScan('#iso-more'); }); }); -- 2.5.5

Reviewed-By: Paulo Vital <pvital@linux.vnet.ibm.com> On Fri, 2016-09-23 at 09:21 -0300, Aline Manera wrote:
Aline Manera (3): Fix issue #1020: Verify libvirt access on real file path instead of symlink Fix issue #1020: Fix alert icon position to do not overlay img/iso icon Bug fix: Disable "Search More ISOs" button on create Template dialog when the operation is in progress
model/storagevolumes.py | 3 ++- model/templates.py | 5 +++-- ui/css/kimchi.css | 4 ++-- ui/css/src/modules/_templates.scss | 4 ++-- ui/js/src/kimchi.template_add_main.js | 1 + 5 files changed, 10 insertions(+), 7 deletions(-)
participants (2)
-
Aline Manera
-
Paulo Ricardo Paz Vital