Changeset 2927


Ignore:
Timestamp:
Aug 14, 2010 3:48:04 PM (9 years ago)
Author:
wehart
Message:

Added logic to confirm that a license is available if it has been reserved.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.opt/trunk/coopr/opt/solver/ilmcmd.py

    r1768 r2927  
    1717import re
    1818import sys
     19import os
    1920
    2021class ILMLicensedSystemCallSolver(shellcmd.SystemCallSolver):
     
    4041            for line in log.split("\n"):
    4142                tokens = re.split('[\t ]+',line.strip())
    42                 if len(tokens) == 3 and tokens[0] == 'available' and tokens[1] == 'tokens:':
     43                if len(tokens) == 5 and tokens[0] == 'tokens' and tokens[1] == 'reserved:' and tokens[4] == os.environ.get('USER',None):
     44                    if not (tokens[2] == 'none' or tokens[2] == '0'):
     45                        return True
     46                    return False
     47                elif len(tokens) == 3 and tokens[0] == 'available' and tokens[1] == 'tokens:':
    4348                    if tokens[2] == '0':
    4449                        return False
Note: See TracChangeset for help on using the changeset viewer.