made license check tolerate non-existing licenses

This commit is contained in:
Martin Diehl 2014-10-21 05:40:26 +00:00
parent d6d02b3b5d
commit 84df61d4a0
1 changed files with 14 additions and 11 deletions

View File

@ -39,6 +39,7 @@ class Environment():
'standard':5,
'explicit':5}
if Nneeded == -1: Nneeded = licensesNeeded[software]
try:
cmd = """ ssh mulicense2 "/Stat_Flexlm | grep 'Users of %s: ' | cut -d' ' -f7,13" """%software
process = subprocess.Popen(shlex.split(cmd),stdout = subprocess.PIPE,stderr = subprocess.PIPE)
licenses = map(int, process.stdout.readline().split())
@ -51,3 +52,5 @@ class Environment():
except IndexError:
print('Could not retrieve license information for %s'%software)
return 127
except:
return 126