[megaclisas-status] Minor fix when MegaCli* is not found in the PATH...

This commit is contained in:
Vincent S. Cojot 2016-02-18 16:01:50 -05:00
parent 4bfc7d7dfb
commit 26094a11b3

View File

@ -90,11 +90,11 @@ 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 (megaclipath != None):
if os.path.exists(megaclipath) and os.access(megaclipath, os.X_OK): if os.path.exists(megaclipath) and os.access(megaclipath, os.X_OK):
pass pass
else: else:
@ -103,6 +103,9 @@ else:
else: else:
print 'Cannot find ' + megaclipath + 'in your PATH. Please install it.' print 'Cannot find ' + megaclipath + 'in your PATH. Please install it.'
sys.exit(3) sys.exit(3)
else:
print 'Cannot find "MegaCli64","MegaCli" or "megacli" in your PATH. Please install it.'
sys.exit(3)
#### pdb.set_trace() #### pdb.set_trace()