Vinzenz Feenstra has uploaded a new change for review.

Change subject: Fix exceptions on guest os reporting
......................................................................

Fix exceptions on guest os reporting

Change-Id: I626081377ca6eb25588f4fc42aa70af7048ab7bd
Signed-off-by: Vinzenz Feenstra <vfeen...@redhat.com>
---
M ovirt-guest-agent/GuestAgentLinux2.py
1 file changed, 5 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-guest-agent 
refs/changes/60/42260/1

diff --git a/ovirt-guest-agent/GuestAgentLinux2.py 
b/ovirt-guest-agent/GuestAgentLinux2.py
index b5a36e5..a32e82f 100644
--- a/ovirt-guest-agent/GuestAgentLinux2.py
+++ b/ovirt-guest-agent/GuestAgentLinux2.py
@@ -255,10 +255,11 @@
         try:
             p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
             for line in p.stdout.read().split('\n'):
-                k, v = line.split('=', 1)
-                if v and k in result:
-                    result[k] = v
-            p.close()
+                line = line.strip()
+                if line:
+                    k, v = line.split('=', 1)
+                    if v and k in result:
+                        result[k] = v
         except Exception:
             logging.exception('ovirt-osinfo invocation failed')
         return result


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I626081377ca6eb25588f4fc42aa70af7048ab7bd
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-guest-agent
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeen...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to