From 88965ef840b607a75582173b6b42617b27d45d00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1ll=20Gu=C3=B0j=C3=B3n=20Sigur=C3=B0sson?= Date: Thu, 2 Sep 2010 18:12:32 +0000 Subject: [PATCH] --- check_eva/trunk/check_eva.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/check_eva/trunk/check_eva.py b/check_eva/trunk/check_eva.py index 3d3aa22..96770a3 100644 --- a/check_eva/trunk/check_eva.py +++ b/check_eva/trunk/check_eva.py @@ -146,7 +146,7 @@ def runCommand(command): if proc.returncode > 0: print "Error %s: %s\n command was: '%s'" % (proc.returncode,stderr.strip(),command) if proc.returncode == 127: # File not found, lets print path - path=os.getenv("PATH") + path=getenv("PATH") print "Current Path: %s" % (path) exit(unknown) else: @@ -520,9 +520,12 @@ def check_controllers(): def set_path(): global path - if path == '': - path = "C:\Program Files\Hewlett-Packard\Sanworks\Element Manager for StorageWorks HSV" current_path = getenv('PATH') + if path == '': + if current_path.find('C:\\') > 1: # We are on this platform + path = "C:\Program Files\Hewlett-Packard\Sanworks\Element Manager for StorageWorks HSV" + else: + path = "/usr/local/bin" current_path = "%s:%s" % (current_path,path) putenv('PATH', current_path) set_path()