mirror of
https://github.com/eLvErDe/hwraid.git
synced 2025-07-27 07:44:01 +02:00
[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..')
|
dbgprint ('Looking for '+str(megabin)+' in PATH next..')
|
||||||
megaclipath = which(megabin)
|
megaclipath = which(megabin)
|
||||||
if (megaclipath != None):
|
if (megaclipath != None):
|
||||||
|
dbgprint ('Will use MegaCLI from here: '+str(megaclipath))
|
||||||
break
|
break
|
||||||
else:
|
|
||||||
dbgprint ('Found MegaCLI here: '+str(megaclipath))
|
|
||||||
|
|
||||||
# Check binary exists (and +x), if not print an error message
|
# Check binary exists (and +x), if not print an error message
|
||||||
if os.path.exists(megaclipath) and os.access(megaclipath, os.X_OK):
|
if (megaclipath != None):
|
||||||
pass
|
if os.path.exists(megaclipath) and os.access(megaclipath, os.X_OK):
|
||||||
else:
|
pass
|
||||||
if nagiosmode:
|
|
||||||
print 'UNKNOWN - Cannot find '+megaclipath
|
|
||||||
else:
|
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)
|
sys.exit(3)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user