schrodinger.application.licensing.licadmin module

schrodinger.application.licensing.licadmin.set_server_refresh(refresh)

This function allows you to prevent _load_tokens from actually hitting the license servers/files again. This is dangerous unless you’re sure you’re the only user of licadmin.py, and you really don’t want to reload the tokens. PANEL-5146

Parameters

refresh (bool) – Whether to refresh tokens when _load_tokens is called

class schrodinger.application.licensing.licadmin.Status(*args)

Bases: object

A Status object represents the “health” of a license resource. It’s an immutable object, with integer and string values.

__init__(code, description)
exception schrodinger.application.licensing.licadmin.MissingExecutableError

Bases: Exception

If the requested path doesn’t point to a valid executable. Used SCHRODINGER_LMUTIL does not point to a valid lmutil.

__init__(*args, **kwargs)
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception schrodinger.application.licensing.licadmin.MissingLicenseFile

Bases: Exception

If no valid server license can be found.

__init__(*args, **kwargs)
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class schrodinger.application.licensing.licadmin.stat_info(total, used)

Bases: tuple

__contains__(key, /)

Return key in self.

__len__()

Return len(self).

count(value, /)

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

total

Alias for field number 0

used

Alias for field number 1

class schrodinger.application.licensing.licadmin.LicenseFeature(name, version='', location='', lictype='', hostid='', starts='', tokens=0, expires=None, ok=None, error=None)

Bases: object

A LicenseFeature object represents a particular license feature provided by a LicenseResource. It records the license information reported by the lmdiag utility. There may be more than one LicenseFeature for a given feature name.

__init__(name, version='', location='', lictype='', hostid='', starts='', tokens=0, expires=None, ok=None, error=None)
set_starts(starts)
set_expires(expires)
set_hostid(hostid)
set_tokens(tokens)
class schrodinger.application.licensing.licadmin.LicenseResource(location, source=None)

Bases: object

A LicenseResource object represents a single license file or license server (port@host). The object records how the resource was found and what licenses it provides.

LEAK_VERSIONS = ['v11.12']
__init__(location, source=None)
Parameters
  • location (pathlib.Path or str) – pathname of license file or port@host address of a license server

  • source (str) – name of the environment variable that specified this resource, or the pathname of the directory where it was found.

errors()
outdated_server()
memory_leak_server()
location()
pathname()

The pathname for the license file. If the license file location isn’t known, return the empty string.

server_pathname()

The license pathnames to use if we’re starting a license server for this license file. If the file is in a licenses/ directory, we start the server using all of the server license files for this machine in the directory, not just this one. The pathnames are returned as a single string, with pathnames separated by the system path separator, e.g., “/licenses/server1.lic:/licenses/license2.lic”.

server_version()
refresh()
is_server()
is_stub()
logfile()
server_hostnames()

Returns the list of hostnames for this license server. If we have a license file, the hostnames from the SERVER lines in that file are returned, in an arbitrary order. If we have a port@host address, the list will just include the host name from that address.

server_hostids()

Returns the list of hostids from the SERVER lines in the license file. The order in which the hostids is returned is arbitrary, and shouldn’t be expected to match the order of SERVER lines in the file.

server_hostid()

Returns the set of hostid for the SERVER line in the license file. If there’s more than one SERVER line, one of them is arbitrarily chosen, which probably isn’t what we want.

server_host_and_port()

Returns the hostname and port number for the server as a tuple (host, port). (Both values are strings.) The port number may be an empty string, if it’s not specified in the license. The host name will be empty if this license resource doesn’t represent a server.

schrod_port()

Returns the port number for the SCHROD daemon, as a string. The empty string may be returned if the port number isn’t specified in the license, or if this license resource doesn’t represent a server.

canonical_filename(preserve_if_possible=True)

Returns the license object’s canonical base filename

If the filename already matches the canonical pattern, return it.

stub_license()
is_local_server()

Return true if this resource represents a license server that is can be started on the current machine.

lmdiag()

Run lmdiag for this license resource. This is mainly useful for debugging.

The raw output from the command is returned.

lmstat()

Run lmstat for this license resource, if it represents a license server. This is mainly useful for debugging.

The raw output from the command is returned.

checkout(token, version=None, count=None, exists=False)

Try to check out the specified token from this license resource. A version number and token count can be specified, as well, but this shouldn’t be necessary for most purposes.

If the exists argument is True, then an existence check is done instead of a checkout.

Returns True if the checkout succeeded, otherwise False.

health()

Return a status code indicating the general “health” of this resource. RESOURCE_OK means the resource can provide licenses. RESOURCE_PROBLEMS means all licenses that should be available aren’t. RESOURCE_UNAVAILABLE means this resource is unable to provide licenses.

Because this evaluation requires executing lmdiag and lmstat, it may take a few seconds.

summary()
add_error(error)
ident()

Return an identifier that can be used to decide whether two license resources are really the same.

Two server-based licenses are considered the same if the server hostnames are the same. (There can only be one server per host.) All non-server-based license files are considered unique.

priority()

Return a priority score for this resource. (Lower numbers indicate higher priority, with zero the highest priority.)

tokens()
available_tokens()

Return a dict mapping feature names to the number of tokens available for each.

total_tokens()

Return a dict mapping feature names to the number of tokens provided by this resource for each.

jobs(jobtypes=None)

Return a dict mapping each job type to the number of jobs that can be run given the available tokens.

class schrodinger.application.licensing.licadmin.LocalServerProcess

Bases: schrodinger.application.licensing.licadmin.LicenseResource

__init__()
Parameters
  • location (pathlib.Path or str) – pathname of license file or port@host address of a license server

  • source (str) – name of the environment variable that specified this resource, or the pathname of the directory where it was found.

errors()

Return the errors of localserver license resources.

numResources()
clearResources()

Clears the license resources that are registered with this process.

addResource(resource)

Register a new license resource. The resource must be a local server license, and it must be good. Use checkResource() first to determine whether the license is good before adding.

Parameters

resource (LicenseResource) – the local server license resource to add

setTemplateResource(resource)

Sets a known good license from which to obtain generic information, such as pathname, version, logfile, etc.

Parameters

resource (LicenseResource) – the local server license to use as a template

checkResource(resource)

Check the health of a local server resource by using this local server process. This will by necessity stop and start the server process.

If the license server was running before this method was called, it will be restarted.

Parameters

resource (LicenseResource) – the local server license to check

checkRunning()

Checks whether the server process is currently running.

isRunning()

Whether the server process is currently running. This will actively check the running state if it has not yet been checked. Otherwise, the running state is passively tracked via an internal variable.

health()

Returns the health of server process if there are any license resources to serve. Otherwise returns RESOURCE_UNAVAILABLE and sets no errors. The health of the server process aggregates the health of all added resources.

waitForSchrodDaemon(license_file, timeout=60)

Wait timeout seconds for lmstat to report if SCHROD vendor daemon is UP or DOWN. This will allow further operations to read the server log or get features to be reliable.

start(logfile=None, append_log=True)

Starts the server process with all the local license resources that have been added.

stop(pathname=None, anydaemon=False)

Stops the server process (both SCHROD and LMGRD).

Parameters

anydaemon (bool) – If set to True, this will allow stopping non-SCHROD vendor daemon. This is mostly used for automated testing purpose.

LEAK_VERSIONS = ['v11.12']
add_error(error)
available_tokens()

Return a dict mapping feature names to the number of tokens available for each.

canonical_filename(preserve_if_possible=True)

Returns the license object’s canonical base filename

If the filename already matches the canonical pattern, return it.

checkout(token, version=None, count=None, exists=False)

Try to check out the specified token from this license resource. A version number and token count can be specified, as well, but this shouldn’t be necessary for most purposes.

If the exists argument is True, then an existence check is done instead of a checkout.

Returns True if the checkout succeeded, otherwise False.

ident()

Return an identifier that can be used to decide whether two license resources are really the same.

Two server-based licenses are considered the same if the server hostnames are the same. (There can only be one server per host.) All non-server-based license files are considered unique.

is_local_server()

Return true if this resource represents a license server that is can be started on the current machine.

is_server()
is_stub()
jobs(jobtypes=None)

Return a dict mapping each job type to the number of jobs that can be run given the available tokens.

lmdiag()

Run lmdiag for this license resource. This is mainly useful for debugging.

The raw output from the command is returned.

lmstat()

Run lmstat for this license resource, if it represents a license server. This is mainly useful for debugging.

The raw output from the command is returned.

location()
logfile()
memory_leak_server()
outdated_server()
pathname()

The pathname for the license file. If the license file location isn’t known, return the empty string.

priority()

Return a priority score for this resource. (Lower numbers indicate higher priority, with zero the highest priority.)

refresh()
schrod_port()

Returns the port number for the SCHROD daemon, as a string. The empty string may be returned if the port number isn’t specified in the license, or if this license resource doesn’t represent a server.

server_host_and_port()

Returns the hostname and port number for the server as a tuple (host, port). (Both values are strings.) The port number may be an empty string, if it’s not specified in the license. The host name will be empty if this license resource doesn’t represent a server.

server_hostid()

Returns the set of hostid for the SERVER line in the license file. If there’s more than one SERVER line, one of them is arbitrarily chosen, which probably isn’t what we want.

server_hostids()

Returns the list of hostids from the SERVER lines in the license file. The order in which the hostids is returned is arbitrary, and shouldn’t be expected to match the order of SERVER lines in the file.

server_hostnames()

Returns the list of hostnames for this license server. If we have a license file, the hostnames from the SERVER lines in that file are returned, in an arbitrary order. If we have a port@host address, the list will just include the host name from that address.

server_pathname()

The license pathnames to use if we’re starting a license server for this license file. If the file is in a licenses/ directory, we start the server using all of the server license files for this machine in the directory, not just this one. The pathnames are returned as a single string, with pathnames separated by the system path separator, e.g., “/licenses/server1.lic:/licenses/license2.lic”.

server_version()
stub_license()
summary()
tokens()
total_tokens()

Return a dict mapping feature names to the number of tokens provided by this resource for each.

schrodinger.application.licensing.licadmin.healthier(health1, health2)

Return True if health1 is healthier than health2.

schrodinger.application.licensing.licadmin.tokens(licenses)

Report number of tokens provided by and currently available from the given license resources. Returns a dict mapping token name to stat_info tuple for each token.

schrodinger.application.licensing.licadmin.job_capacity(resources)

Report number of jobs that can be run with the tokens available on the given license resources.

Returns a dict mapping the jobtype to the number of jobs that can be run, with licenses available from the given resources.

schrodinger.application.licensing.licadmin.get_hostid()

Get the hostid for the current machine using “lmutil lmhostid”. Generally, this will be the MAC address(es) for the ethernet interface.

Returns the hostid string reported for the current host.

schrodinger.application.licensing.licadmin.get_first_hostid()

Get the hostid for the current machine using get_hostid(). This will always return the first MAC address found by ‘lmutil lmhostid’ for the current host.

Returns

first host id given by get_hostid()

Return type

str

schrodinger.application.licensing.licadmin.execute_lmutil(args)

Execute the lmutil program with the given commandline arguments. The arguments must be specified as list.

The raw output of the command is returned.

If the exit code is non-zero it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, the output in the output attribute, and the command in the cmd attribute.

If lmutil cannot be executed, raises a MissingExecutableError or an OSError.

schrodinger.application.licensing.licadmin.execute_lictest(args)

Execute the lictest program with the given commandline arguments. The arguments must be specified as list.

The raw output of the command is returned.

If the exit code is non-zero it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode attribute, the output in the output attribute, and the command in the cmd attribute.

schrodinger.application.licensing.licadmin.parse_lmhostid_output(lines)

Parse the output from “lmutil lmhostid”, provided as a list of output lines.

Returns the hostid string for the current host.

schrodinger.application.licensing.licadmin.run_lmstat(license_file, parsefeatures=False)

Get license usage information from a server via “lmutil lmstat”.

Parameters
  • license_file (str) – Path to the license file to use with ‘lmutil lmstat’.

  • parsefeatures (bool) – If set to True, the returned dict will have a mapping of the token name to a stat_info named tuple for each license feature. A stat_info tuple has integer fields ‘total’ and ‘used’, recording the total tokens provided and the number in use.

Returntpe

dict

Returns

Dictionary containing the metadata of license server and vendor daemon corresponding to the given license file.

schrodinger.application.licensing.licadmin.is_unreachable_hostname(error, license_file)

Return True if error matches the case where the hostname on the license server is not an accesible hostname. This manifests as lmstat returning -96, but we are still able to use mmlic3.

Parameters
  • error (LicenseError) – from parse_lmstat_output

  • license_file (str) – path to the license file to use with licstat

schrodinger.application.licensing.licadmin.is_future_license_error(info)

Return True if this represents a license with a future start date.

Parameters

info (ServerInfo) – Representation of a Server instance

Return type

bool

schrodinger.application.licensing.licadmin.parse_lmstat_output(lines)

Parse the output from “lmutil lmstat”, provided as a list of output lines.

Parameters

lines (list(str)) – Output of ‘lmutil lmstat’.

Returntype

dict

Returns

Dictionary of license server, vendor daemon metadata

Metadata info:

"address"           port@host address of the license server.
"server_version"    lmgrd version number, e.g., "v11.10.2" or
                    VERSION_UNKNOWN if indeterminate. This is only
                    returned in the case of
                    running lmstat on a remote server.
"server_up"         True, if lmgrd is UP; else, False.
"version"           SCHROD daemon version number or VERSION_UNKNOWN if
                    indeterminate.
"schrod_up"         True, if SCHROD is up; False if down.
"tokens"            tokens dict is a mapping of the feature name to
                    a stat_info named tuple for that feature. A
                    stat_info tuple has integer fields 'total' and
                    'used', recording the total tokens provided and
                    the number in use. If the output lines doesn't
                    have users of feature(s), this will be empty.
schrodinger.application.licensing.licadmin.run_lmdiag(locations, feature='')

Get diagnostic information regarding one or more license resources via “lmutil lmdiag”.

The argument ‘locations’ is a string representing a FLEXLM search path, such as $SCHROD_LICENSE_FILE.

Returns a dict with an entry for each license resource that was examined. For each resource, returns a dict mapping the feature name to a list of LicenseFeature objects, each representing the diag info for a single license line for that feature. (There may be more than one.)

Raises licerror.LicenseException, otherwise.

schrodinger.application.licensing.licadmin.parse_lmdiag_output(lines)

Parse the output from “lmutil lmdiag”, provided as a list of output lines.

Returns a dict with an entry for each license resource that was examined. For each resource, returns a dict mapping the feature name to a list of LicenseFeature objects, each representing the diag info for a single license line for that feature. (There may be more than one.)

schrodinger.application.licensing.licadmin.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.

A continued line is indicated by a trailing comma.

schrodinger.application.licensing.licadmin.parse_lmdiag_entry(lines)

Returns a LicenseFeature object, representing the information reported by lmdiag for that feature.

schrodinger.application.licensing.licadmin.load_job_reqs(filename='')

Read a json document describing the license requirements for each job that a user could launch.

The license requirements for a given job are represented as a dict, mapping the token name to the number of tokens required for that job. A job may accept more than one combination of tokens.

Return a dict mapping the job type to a list of dicts, each representing an acceptable set of licenses for that job.

If the file can’t be loaded, an exception will be thrown.

schrodinger.application.licensing.licadmin.load_job_products(filename='')

Read a json document listing the product names under which job types should be grouped.

Returns a list of product names.

If the file can’t be loaded, an exception will be thrown.

schrodinger.application.licensing.licadmin.find_license_resources(unique=True)

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.

License resources may be specified using the environment variables

$SCHROD_LICENSE_FILE
$LM_LICENSE_FILE

… which can each specify a list of license files and/or license servers.

License resources will also be found automatically if installed in one of the standard locations that mmlic3 is hard-wired to search. These are

$SCHRODINGER/licenses/*.lic
$SCHRODINGER/license{,.txt}

… and, depending on the platform,

MacOSX:
/Library/Application Support/Schrodinger/licenses/*.lic
/Library/Application Support/Schrodinger/license{,.txt}

Windows:
C:/ProgramData/Schrodinger/licenses/*.lic
C:/ProgramData/Schrodinger/license{,.txt}

Linux
/opt/schrodinger/licenses/*.lic
/opt/schrodinger/license{,.txt}

Returns a list of LicenseResource objects.

Parameters

unique (bool) – if False, duplicates of server files. (see _unique_resources)

schrodinger.application.licensing.licadmin.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.

schrodinger.application.licensing.licadmin.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.

schrodinger.application.licensing.licadmin.resource_summary(resources)

Provide a condensed list of license resources. Each license server is listed, but the existence of node-locked licenses. The health of each listed resource is indicated with a status code, which will be one of RESOURCE_OK, RESOURCE_PROBLEMS, RESOURCE_UNAVAILABLE.

schrodinger.application.licensing.licadmin.hostid_is_local(lic_hostid)

Returns True if the given hostid matches the local hostid.

schrodinger.application.licensing.licadmin.hostname_is_local(hostname)

Determine whether the given hostname refers to the current host.

schrodinger.application.licensing.licadmin.is_ipv4_addr(addr)

Determine whether the given string is an IPv4 address.

schrodinger.application.licensing.licadmin.server_log(licfile)

Return the standard pathname for the lmgrd log file associated with the given license file.

If the license is just a port@host server address, the empty string is returned, because we have no idea where the logs would be.

schrodinger.application.licensing.licadmin.writable_server_log(licfile, prefer_logfile='')

Return the pathname for the log file to use when launching a server for the given license file. The returned pathname will be writable by the current user.

This differs from server_log() in that it will check for alternative locations and filenames if the standard lmgrd.log file can’t be written.

A suggested logfile pathname can be specified. If this file is writable, it will be returned.

schrodinger.application.licensing.licadmin.can_write_file(pathname)

Returns true if the filesystem permissions appear to allow the specified file to be written.

schrodinger.application.licensing.licadmin.create_stub_license(host, port='')

Create a stub license file, which points to a remote license server.

class schrodinger.application.licensing.licadmin.ServerInfo

Bases: object

A ServerInfo object represents the information reported in the lmgrd log when a license server is started.

__init__()
add_error(err)
schrodinger.application.licensing.licadmin.parse_lmgrd_log(filename, offset=0)
schrodinger.application.licensing.licadmin.parse_lmgrd_lines(lines)

Parse an lmgrd log file for messages related to the health of the lmgrd and SCHROD daemons. The log file is supplied as a list of lines.

A ServerInfo object is returned

schrodinger.application.licensing.licadmin.version_uptodate(version)

Returns True unless the given lmgrd version number is older than the version included in our release, given by the REQUIRED_MAJOR_VERSION and REQUIRED_MINOR_VERSION constants.

schrodinger.application.licensing.licadmin.parse_lmgrd_event(eventdict, line)
schrodinger.application.licensing.licadmin.lmgrd_lines(lines)

A generator to perform initial parsing of lmgrd logfile lines.

A sequence of tuples (timestamp, prog, text) is returned. Lines for any prog other than “lmgrd” or “SCHROD” are discarded.

schrodinger.application.licensing.licadmin.resources()

Return a list of all license resources found.

schrodinger.application.licensing.licadmin.get_local_server()
schrodinger.application.licensing.licadmin.local_server_resource()

Returns the first license resource found for the local license server, if any. There may be multiple license servers, but only one that can run on the current machine. Only a local license server can be started or stopped by the user. Returns None if no local license server is found.

NOTE: To start or stop a local license server, you’ll need all of the license files for that server - there may be more than one. Use the local_server_resources() function to get the complete list.

schrodinger.application.licensing.licadmin.local_server_resources()

Returns the license resources that represent the local license server. There may be multiple license servers, but only one that can run on the current machine. Only a local license server can be started or stopped by the user. Returns the empty list if no local license server files are found.

schrodinger.application.licensing.licadmin.get_working_resources(license_resources=None)

Returns list of LicenseResources without any all-expired files. This is useful for user-facing presentation.

Parameters

license_resources (list(LicenseResource objects)) – list of license resource, if none specified search all available

schrodinger.application.licensing.licadmin.refresh()

Force license-resource info to be re-loaded.

schrodinger.application.licensing.licadmin.local_server_files(dirname)

Given the name of a license directory, return a list of the license files found therein that can be used to start a local license server. Because the directory is a license directory, license files need to have a .lic suffix.

schrodinger.application.licensing.licadmin.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.

The structure of the return value is

{ <product1>: [ (<jobtype1>, <number of jobs>),
                (<jobtype2>, <number of jobs>),
              ... ],
  <product2>: [ (<jobtype1>, <number of jobs>),
                (<jobtype2>, <number of jobs>),
              ... ],
}

By default, checks all available resources, but the res_list parameter can be used to restrict the report to a specified collection of resources.

schrodinger.application.licensing.licadmin.job_product_names()

Return Schrodinger product names. :rtype: list(str)

schrodinger.application.licensing.licadmin.get_key_name(product_name)

Return canonicalized name for string matching. :param: str product_name: Name of a Schrodinger product.

schrodinger.application.licensing.licadmin.get_product(jobtype, products)

Return a product name for a job type that is in products list. :param str jobtype: Type of a Schrodinger product job. :param products: List of Schrodinger product names. :type list(str)

schrodinger.application.licensing.licadmin.get_jobtype_name(jobtype, product)

Return jobname for jobtypes in Schrodinger product list. :param str jobtype: Type of a Schrodinger product job. :param str product: Name of a Schrodinger product.

schrodinger.application.licensing.licadmin.license_directory()

Return the pathname of the directory into which license files should be installed.

The first writable directory found among the following will be returned: 1. the shared license directory, 2. $SCHRODINGER/licenses

The returned license directory will be created, as a side effect, if it doesn’t already exist.

exception schrodinger.application.licensing.licadmin.UsageError

Bases: Exception

This exception is thrown when unrecognized or incompatible commandline options are used.

__init__(*args, **kwargs)
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception schrodinger.application.licensing.licadmin.NetsuiteError

Bases: Exception

This exception is raised when there’s a problem obtaining a license from the NetSuite server.

__init__(*args, **kwargs)
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

schrodinger.application.licensing.licadmin.parse_args(args)

Parse the commandline arguments for the licadmin utility.

If incompatible options are specified a UsageError is thrown.

Returns a namespace object with the values of the commandline options. The subcommand (“START”, “INFO”, etc.) is returned as the “action” attribute of the namespace object.

schrodinger.application.licensing.licadmin.handle_start_action(opts)

Start a local license server.

schrodinger.application.licensing.licadmin.handle_stop_action(opts)

Stop a local license server.

schrodinger.application.licensing.licadmin.handle_stat_action(opts)

Execute “lmutil lmstat -a” for the specified license.

schrodinger.application.licensing.licadmin.handle_diag_action(opts)

Execute “lmutil lmdiag -n” for the specified license.

schrodinger.application.licensing.licadmin.handle_ver_action(opts)

Execute “lmutil lmver” for the specified executable. Lines containing “lmutil” are stripped from the result.

schrodinger.application.licensing.licadmin.handle_list_action(opts)

List all known license resources.

schrodinger.application.licensing.licadmin.validate_connection(host, port, timeout=None)

Attempt to connect to a specified host and port.

Parameters
  • host (str) – the host to connect to

  • port (int) – the port to connect to

Returns

a 2-tuple describing whether the connection was successful, and if not, an error message

Return type

tuple(bool, str)

schrodinger.application.licensing.licadmin.validate_license_host_port(host, port, timeout=None)

Validate the given license server host and port. If the port is empty, the default lmgrd port ranges are checked.

Parameters
  • host (str) – the license server host to connect to

  • port (str) – the license server port to connect to

  • timeout (int) – How long in seconds to wait for each connection

Returns

list of list with each list representing the host, port, status of connection and an error message.

schrodinger.application.licensing.licadmin.handle_check_action(opts)

Report the status of all known license resources.

schrodinger.application.licensing.licadmin.handle_verify_action(opts)

Verify the signatures in the specified license file, using lictest.

schrodinger.application.licensing.licadmin.handle_generic_action(action, opts)

Execute the lmutil subcommand for the given action.

schrodinger.application.licensing.licadmin.handle_install_action(opts)

Install a license in the license directory. If a license key is given, download the license from Netsuite, first.

schrodinger.application.licensing.licadmin.install_remote_server_license(lic_server_address)

Generate a license file pointing to a remote server, and install it in the license directory.

Parameters

lic_server_address (str) – The address of the license server, in the form “port@host”.

schrodinger.application.licensing.licadmin.install_netsuite_license(key)

Download a license from Netsuite using the given key, and install it in the license directory.

schrodinger.application.licensing.licadmin.get_netsuite_license(key)

Download a license from Netsuite, using the given key.

Returns the pathname of the downloaded file. A NetsuiteError is raised if there’s a problem using the given license key.

schrodinger.application.licensing.licadmin.download_server_license(key, hostname=None, hostid=None, lmgrdport=27008, schrodport=53000)

Retrieves the server license corresponding to the key and saves it to disk, in the license directory. The lmgrd and SCHROD ports to use in the license may be specified.

Returns the pathname of the downloaded file. A NetsuiteError is raised if there’s a problem using the given license key.

Parameters

hostid (str) – If more than one host id is given, this value must be a string of comma-separated host ids. Otherwise NetSuite will throw an error.

schrodinger.application.licensing.licadmin.download_nodelocked_license(key, hostname=None, hostid=None)

Retrieves the license corresponding to the key and saves it to disk, in the licenses directory.

Returns the pathname of the downloaded file. A NetsuiteError is raised if there’s a problem using the given license key.

Parameters

hostid (str) – If more than one host id is given, this value must be a string of comma-separated host ids. Otherwise NetSuite will throw an error.

schrodinger.application.licensing.licadmin.install_license_text(text)

Install the given text as a license file, with the canonical filename. If it’s already installed, nothing is done. The pathname of the installed license is returned.

schrodinger.application.licensing.licadmin.install_license(filename)

Copy the given license file to the standard licenses directory and give it its canonical filename. If it’s already in the licenses directory, it’s just renamed. If its name already matches the canonical pattern, it is not renamed.

schrodinger.application.licensing.licadmin.installed_pathname(filename)

Check whether the given license file is already installed in the licenses directory under a different name. Return the pathname of the installed license, if it’s found there, otherwise, return None.

schrodinger.application.licensing.licadmin.file_dirname(pathname)

Return the name of the directory containing the given file.

schrodinger.application.licensing.licadmin.write_file(filename, contents)

Writes the given content into a file in the CWD. The full pathname of the written file is returned.

schrodinger.application.licensing.licadmin.working_directory(new_cwd)

Change the CWD within some limited context

schrodinger.application.licensing.licadmin.temporary_directory()

Create a temporary directory and make that the current directory in this context. When the context is exited, chdir back to the original directory and delete the temporary directory.

schrodinger.application.licensing.licadmin.handle_info_action(opts)

Create an archive of information for troubleshooting license issues.

schrodinger.application.licensing.licadmin.options_file(licfile='')

Return the pathname of the FLEXlm options file associated with the given license.

schrodinger.application.licensing.licadmin.system_hosts_file()

Return the pathname of the /etc/hosts file, or its equivalent.

schrodinger.application.licensing.licadmin.get_machid_output()

Return the output of the machid utility

schrodinger.application.licensing.licadmin.get_network_info()

Return network configuration info from ifconfig.

schrodinger.application.licensing.licadmin.get_mmshare_listing()

Return info about the mmshare directory.

schrodinger.application.licensing.licadmin.get_shared_file_listing()

Return info about files installed in the shared license directory.

schrodinger.application.licensing.licadmin.get_server_processes()

Return info about any running lmgrd and SCHROD processes.

schrodinger.application.licensing.licadmin.process_attributes(proc, attrs)

Return a dict containing the specified attributes for the given psutil.Process object.

Make sure that filler values for unavailable data are of the correct type (LIC-548)

schrodinger.application.licensing.licadmin.create_archive_file(archive_file, archive_dir)

Create a zip archive with the contents of archive_dir

schrodinger.application.licensing.licadmin.shorthost(hostname)

Return the short hostname for the given hostname, without the domain name. If hostname is an IP address, it is returned unmodified.

schrodinger.application.licensing.licadmin.get_flexlm_search_path()

Execute “lmutil lmpath” to determine the actual search path used for license checkouts.

schrodinger.application.licensing.licadmin.has_license_file_suffix(filename)
schrodinger.application.licensing.licadmin.eth0_is_missing()
schrodinger.application.licensing.licadmin.install_schrod_plist()

Install FLEXlm plist to /Library/LaunchDaemons which allow to autostart lmgrd and SCHROD on boot. This require root privilege to install to the location.

schrodinger.application.licensing.licadmin.getLicenseFileList()

Get the list of license files to use from available resources.

schrodinger.application.licensing.licadmin.feature_expiring(feature, days=30)

Return False if the given license feature doesn’t expire in given number of days. True, otherwise.

schrodinger.application.licensing.licadmin.main(args)
schrodinger.application.licensing.licadmin.run(args)