[megaclisas-status] Improve looking for Megacli a tad...

This commit is contained in:
Vincent S. Cojot 2015-11-05 11:26:23 -05:00
parent 2229dcc5cb
commit 123ef59da8

View File

@ -85,11 +85,13 @@ def which(program):
return None return None
# Find MegaCli # Find MegaCli
megaclipath = which("MegaCli64") for megabin in "MegaCli64","MegaCli","megacli":
if (megaclipath == None): dbgprint ('Looking for '+str(megabin)+' in PATH next..')
megaclipath = which("MegaCli") megaclipath = which(megabin)
if (megaclipath == None): if (megaclipath != None):
megaclipath = "MegaCli" 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 os.path.exists(megaclipath) and os.access(megaclipath, os.X_OK):