[node-patches] Change in ovirt-node[master]: Fix miss code when merged patch http://gerrit.ovirt.org/#/c/...

hadong0720 at gmail.com hadong0720 at gmail.com
Thu Jun 26 02:38:27 UTC 2014


hadong has uploaded a new change for review.

Change subject: Fix miss code when merged patch http://gerrit.ovirt.org/#/c/28893/
......................................................................

Fix miss code when merged patch http://gerrit.ovirt.org/#/c/28893/

Change-Id: Ia81dc8e92c3d016f6cbfd3c5f261303b1dd4515b
Bug-Url:https://bugzilla.redhat.com/show_bug.cgi?id=1110762
Signed-off-by: hadong <hadong at redhat.com>
---
M src/ovirt/node/utils/system.py
1 file changed, 13 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/31/29231/1

diff --git a/src/ovirt/node/utils/system.py b/src/ovirt/node/utils/system.py
index 705dd56..4c7f378 100644
--- a/src/ovirt/node/utils/system.py
+++ b/src/ovirt/node/utils/system.py
@@ -950,9 +950,16 @@
 
     @classmethod
     def _query_lvm(self, option, pv=None):
-        if pv:
-            return [x.strip() for x in process.check_output(["lvm",
-                    "vgs", "--noheadings", "-o", option, pv]).split("\n")]
-        else:
-            return [x.strip() for x in process.check_output(["lvm",
-                    "vgs", "--noheadings", "-o", option]).split("\n")]
+        try:
+            with open(os.devnull, 'wb') as DEVNULL:
+                if pv:
+                    return [x.strip() for x in process.check_output(["lvm",
+                            "vgs", "--noheadings", "-o", option, pv],
+                            stderr=DEVNULL).split("\n")]
+                else:
+                    return [x.strip() for x in process.check_output(["lvm",
+                            "vgs", "--noheadings", "-o", option],
+                            stderr=DEVNULL).split("\n")]
+        except process.CalledProcessError as e:
+            LOGGER.debug("Failed to query lvm: %s" % e.cmd, exc_info=True)
+        return []


-- 
To view, visit http://gerrit.ovirt.org/29231
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia81dc8e92c3d016f6cbfd3c5f261303b1dd4515b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: hadong <hadong0720 at gmail.com>



More information about the node-patches mailing list