[node-patches] Change in ovirt-node[master]: system: Fix which() always return None issue

hadong0720 at gmail.com hadong0720 at gmail.com
Fri Aug 2 11:29:07 UTC 2013


hadong has uploaded a new change for review.

Change subject: system: Fix which() always return None issue
......................................................................

system: Fix which() always return None issue

Change-Id: Ic054a5e48214e9f39994c962863030681c4b3622
Signed-off-by: hadong <hadong0720 at gmail.com>
---
M src/ovirt/node/utils/system.py
1 file changed, 2 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/00/17600/1

diff --git a/src/ovirt/node/utils/system.py b/src/ovirt/node/utils/system.py
index ead2e68..8c541d2 100644
--- a/src/ovirt/node/utils/system.py
+++ b/src/ovirt/node/utils/system.py
@@ -92,9 +92,8 @@
         $PATH. Otherwise None (if not found in any path in $PATHS).
     """
     ret = None
-    if os.path.abspath(cmd):
-        if File(cmd).exists():
-            ret = cmd
+    if os.path.abspath(cmd) and File(cmd).exists():
+        ret = cmd
     else:
         for dirname in os.environ["PATH"].split(":"):
             fn = os.path.join(dirname, cmd)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic054a5e48214e9f39994c962863030681c4b3622
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