Hello Germano Veit Michel, Francesco Romani,

I'd like you to do a code review.  Please visit

    https://gerrit.ovirt.org/47104

to review the following change.

Change subject: vdsm-tool: Do not panic with sanlock empty groups
......................................................................

vdsm-tool: Do not panic with sanlock empty groups

This fixes the following error:

    File "/usr/lib/python2.6/site-packages/vdsm/tool/configurators/
        sanlock.py", line 87, in isconfigured
    .strip().split(" ")]
    ValueError: invalid literal for int() with base 10: ''

Which happens when sanlock "Groups:" line is empty:

    $ grep "Groups:" /proc/<sanlock pid>/status
    Groups:

Sanlock must have its groups properly setup, but we should not
blow up because of this.

Fixed by using split() instead of split(' '), which cannot handle empty
string and is the wrong way to split in most cases.

Change-Id: I47f080beb748353970dec0753c9a0a7b1dd09bc6
Bug-Url:https://bugzilla.redhat.com/1267444
Backport-To: 3.6
Backport-To: 3.5
Signed-off-by: Germano Veit Michel <germ...@redhat.com>
Signed-off-by: Nir Soffer <nsof...@redhat.com>
Reviewed-on: https://gerrit.ovirt.org/46742
Reviewed-by: Francesco Romani <from...@redhat.com>
Continuous-Integration: Dan Kenigsberg <dan...@redhat.com>
---
M lib/vdsm/tool/configurators/sanlock.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/04/47104/1

diff --git a/lib/vdsm/tool/configurators/sanlock.py 
b/lib/vdsm/tool/configurators/sanlock.py
index 71e8a93..aab2bd3 100644
--- a/lib/vdsm/tool/configurators/sanlock.py
+++ b/lib/vdsm/tool/configurators/sanlock.py
@@ -79,7 +79,7 @@
                     if status_line.startswith(proc_status_group_prefix):
                         groups = [int(x) for x in status_line[
                             len(proc_status_group_prefix):]
-                            .strip().split(" ")]
+                            .strip().split()]
                         break
                 else:
                     raise InvalidConfig(


-- 
To view, visit https://gerrit.ovirt.org/47104
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I47f080beb748353970dec0753c9a0a7b1dd09bc6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: Germano Veit Michel <germ...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to