mirror of https://github.com/eLvErDe/hwraid.git
[megaclisas-status] Minor fix when MegaCli* is not found in the PATH...
This commit is contained in:
parent
4bfc7d7dfb
commit
26094a11b3
|
@ -90,18 +90,21 @@ for megabin in "MegaCli64","MegaCli","megacli":
|
|||
dbgprint ('Looking for '+str(megabin)+' in PATH next..')
|
||||
megaclipath = which(megabin)
|
||||
if (megaclipath != None):
|
||||
dbgprint ('Will use MegaCLI from here: '+str(megaclipath))
|
||||
break
|
||||
else:
|
||||
dbgprint ('Found MegaCLI here: '+str(megaclipath))
|
||||
|
||||
# Check binary exists (and +x), if not print an error message
|
||||
if os.path.exists(megaclipath) and os.access(megaclipath, os.X_OK):
|
||||
pass
|
||||
else:
|
||||
if nagiosmode:
|
||||
print 'UNKNOWN - Cannot find '+megaclipath
|
||||
if (megaclipath != None):
|
||||
if os.path.exists(megaclipath) and os.access(megaclipath, os.X_OK):
|
||||
pass
|
||||
else:
|
||||
print 'Cannot find ' + megaclipath + 'in your PATH. Please install it.'
|
||||
if nagiosmode:
|
||||
print 'UNKNOWN - Cannot find '+megaclipath
|
||||
else:
|
||||
print 'Cannot find ' + megaclipath + 'in your PATH. Please install it.'
|
||||
sys.exit(3)
|
||||
else:
|
||||
print 'Cannot find "MegaCli64","MegaCli" or "megacli" in your PATH. Please install it.'
|
||||
sys.exit(3)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue