|
_single_job_capacity(reqs,
tokens)
Calculate the number of jobs that can be run, for a job with the
given token requirements and the given set of available tokens. |
|
|
|
healthier(health1,
health2)
Return True if health1 is healthier than health2. |
|
|
|
tokens(licenses)
Report number of tokens provided by and currently available from the
given license resources. |
|
|
|
job_capacity(resources)
Report number of jobs that can be run with the tokens available on
the given license resources. |
|
|
|
get_hostid()
Get the hostid for the current machine using "lmutil
lmhostid". |
|
|
|
execute_lmutil(args)
Execute the lmutil program with the given commandline arguments. |
|
|
|
execute_lictest(args)
Execute the lictest program with the given commandline arguments. |
|
|
|
parse_lmhostid_output(lines)
Parse the output from "lmutil lmhostid", provided as a list
of output lines. |
|
|
|
run_lmstat(hostport)
Get license usage information from a server via "lmutil
lmstat". |
|
|
|
parse_lmstat_output(lines)
Parse the output from "lmutil lmstat", provided as a list
of output lines. |
|
|
|
run_lmdiag(locations)
Get diagnostic information regarding one or more license resources
via "lmutil lmdiag". |
|
|
|
parse_lmdiag_output(lines)
Parse the output from "lmutil lmdiag", provided as a list
of output lines. |
|
|
|
join_cont_lines(lines)
Returns the input list of lines, after joining any logical lines that
were split across two (or more) physical lines, and stripping leading
and trailing whitespace. |
|
|
|
parse_lmdiag_entry(lines)
Returns a LicenseFeature object, representing the information
reported by lmdiag for that feature. |
|
|
|
load_job_reqs(filename='
' )
Read a json document describing the license requirements for each job
that a user could launch. |
|
|
|
load_job_products(filename='
' )
Read a json document listing the product names under which job types
should be grouped. |
|
|
|
|
|
find_license_resources()
Returns a list of lists of all license resources (license files or
servers) that would be available to a job trying to check out a license. |
|
|
|
_unique_resources(lics)
Filter the given list of LicenseResources to remove redundant resources. |
|
|
|
resources_from_path(search_path,
source='
' )
Parse the given search path (PATH-style) into components and return a
list with the LicenseResource object for each item. |
|
|
|
resources_from_list(license_list,
source)
Return a list with the LicenseResource object for each item (server
hostport, license file or license directory) in the given list. |
|
|
|
|
|
hostid_is_local(lic_hostid)
Returns True if the given hostid matches the local hostid. |
|
|
|
hostname_is_local(hostname)
Determine whether the given hostname refers to the current host. |
|
|
|
is_ipv4_addr(addr)
Determine whether the given string is an IPv4 address. |
|
|
|
server_log(licfile)
Return the standard pathname for the lmgrd log file associated with
the given license file. |
|
|
|
writable_server_log(licfile,
prefer_logfile='
' )
Return the pathname for the log file to use when launching a server
for the given license file. |
|
|
|
can_write_file(pathname)
Returns true if the filesystem permissions appear to allow the
specified file to be written. |
|
|
|
start_server(licfile,
logfile='
' ,
append=True)
Start a license server for the given license file. |
|
|
|
stop_server(licfile)
Stop the license server for the given license file. |
|
|
|
create_stub_license(host,
port='
' )
Create a stub license license file, which points to a remote license
server. |
|
|
|
parse_lmgrd_log(filename,
after=None) |
|
|
|
parse_lmgrd_lines(lines,
after=None)
Parse an lmgrd log file for messages related to the health of the
lmgrd and SCHROD daemons. |
|
|
|
version_uptodate(version)
Returns True unless the given lmgrd version number is older than
v11.12. |
|
|
|
parse_lmgrd_event(eventdict,
line) |
|
|
|
lmgrd_lines(lines)
A generator to perform initial parsing of lmgrd logfile lines. |
|
|
|
resources()
Return a list of all license resources found. |
|
|
|
refresh()
Force license-resource info to be re-loaded. |
|
|
|
hostid()
Return the hostid for the current host. |
|
|
|
local_server()
Returns the license resource representing the local license server,
if any. |
|
|
|
job_capacity_by_product(res_list=None)
Return a dict of lists of tuples, reporting the number of
jobs of each type that can be run, grouped by product. |
|
|
|
license_directory()
Return the pathname of the directory into which license files
should be installed. |
|
|
|
parse_args(args)
Parse the commandline arguments for the licadmin utility. |
|
|
|
handle_start_action(opts)
Start a local license server. |
|
|
|
handle_stop_action(opts)
Stop a local license server. |
|
|
|
handle_stat_action(opts)
Execute "lmutil lmstat -a" for the specified license. |
|
|
|
handle_diag_action(opts)
Execute "lmutil lmdiag -n" for the specified license. |
|
|
|
|
|
handle_list_action(opts)
List all known license resources. |
|
|
|
handle_check_action(opts)
Report the status of all known license resources. |
|
|
|
handle_verify_action(opts)
Verify the signatures in the specified license file, using lictest. |
|
|
|
handle_generic_action(action,
opts)
Execute the lmutil subcommand for the given action. |
|
|
|
|
|
handle_info_action(opts)
Create an archive of information for troubleshooting license issues. |
|
|
|
options_file(licfile='
' )
Return the pathname of the FLEXlm options file associated with the
given license. |
|
|
|
system_hosts_file()
Return the pathname of the /etc/hosts file, or its equivalent. |
|
|
|
get_machid_output()
Return the output of the machid utility |
|
|
|
get_network_info()
Return network configuration info from ifconfig. |
|
|
|
get_mmshare_listing()
Return info about the mmshare directory. |
|
|
|
get_schrod_file_listing()
Return info about license-related files installed under $SCHRODINGER. |
|
|
|
get_shared_file_listing()
Return info about files installed in the shared license directory. |
|
|
|
get_server_processes()
Return info about any running lmgrd and SCHROD processes. |
|
|
|
process_attributes(proc,
attrs)
Return a dict containing the specified attributes for the given
psutil.Process object. |
|
|
|
|
|
|
|
_find_server_logs(licenses)
Return a list of all server logfiles found on the standard search path. |
|
|
|
create_archive_file(archive_file,
archive_dir)
Create a zip archive with the contents of archive_dir |
|
|
|
shorthost(hostname)
Return the short hostname for the given hostname, without the domain
name. |
|
|
|
get_flexlm_search_path()
Execute "lmutil lmpath" to determine the actual search path
used for license checkouts. |
|
|
|
|
|
|
|
fmt = logging.Formatter('%(message)s')
|
|
log = logging.getLogger("licadmin")
|
|
console_handler = logging.StreamHandler(stream= sys.stdout)
|
|
SCHRODINGER = ' /nfs/builds/objects/NB/2015-3/Linux-x86_64/buil ...
|
|
MMSHARE_EXEC = ' /nfs/builds/objects/NB/2015-3/Linux-x86_64/bui ...
|
|
MMSHARE_DATA = ' /nfs/builds/objects/NB/2015-3/Linux-x86_64/bui ...
|
|
LICENSE_DIRNAME = ' licenses '
|
|
LICENSE_FILENAME = ' license '
|
|
LMGRD_LOG = ' lmgrd.log '
|
|
LMGRD_ALTLOG = ' lmgrd.buildbot.log '
|
|
SHARED_LICENSE_DIR = ' /opt/schrodinger '
|
|
JOB_REQS_FILE = ' /nfs/builds/objects/NB/2015-3/Linux-x86_64/bu ...
|
|
JOB_PRODUCTS_FILE = ' /nfs/builds/objects/NB/2015-3/Linux-x86_6 ...
|
|
REQUIRED_MAJOR_VERSION = 11
|
|
REQUIRED_MINOR_VERSION = 13
|
|
UNCOUNTED = -1
|
|
_resources = [ ]
|
|
_hostid = '
'
|
|
_job_reqs = { }
|
|
_job_products = [ ]
|
|
RESOURCE_OK = License OK
|
|
RESOURCE_PROBLEMS = License may have problems
|
|
RESOURCE_UNAVAILABLE = License is unusable
|
|
LMGRD_EVENTS = OrderedDict([('LMGRD_PRE_START', (0, <_sre.SRE_...
|
|
SCHROD_EVENTS = OrderedDict([('SCHROD_START', (0, <_sre.SRE_Pa...
|
|
parser = None
hash(x)
|
|
GENERIC_ACTIONS = ( ' CKSUM ' , ' NEWLOG ' , ' REREAD ' , ' REMOVE ' , ' SWI ...
|
|
LICENSE_ACTIONS = ( ' CKSUM ' , ' DIAG ' , ' INFO ' , ' NEWLOG ' , ' REREAD ' ...
|
|
GENERAL_INFO_FILE = ' general-info.txt '
|
|
GENERAL_INFO_TEMPLATE = Template("""Gene...
|
|
server_ps_attrs = [ ' pid ' , ' ppid ' , ' name ' , ' exe ' , ' memory_info ' ...
|
|
server_ps_head_fmt = ' %-6s %-8s %6s %6s %4s %4s %6s %4s %s '
|
|
server_ps_body_fmt = ' {name:<6s} {username:<8s} {pid:6d} {ppid ...
|
|
LMGRD_ERROR = 1
|
|
LMGRD_INFO = 0
|
|
SCHROD_ERROR = 1
|
|
SCHROD_INFO = 0
|
|
__package__ = ' schrodinger.application.licensing '
|