Package schrodinger :: Module flexlm :: Class LicenseResource
[hide private]
[frames] | no frames]

Class LicenseResource

object --+
         |
        LicenseResource

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

Instance Methods [hide private]
 
__init__(self, location, source=None)
The location may be either a pathname or the port@host address of a license server.
 
__unicode__(self)
 
__repr__(self)
repr(x)
 
location(self)
 
summary(self)
 
add_error(self, message, exc=None)
 
_load_license_file(self, pathname)
Load the license file.
 
_load_tokens(self)
Load the information about the total number of tokens available and the number currently in use.
 
_load_job_reqs(self)
Load the table of license requirements for each joob type.
 
tokens(self)
 
available_tokens(self)
Return a dict mapping feature names to the number of tokens available for each.
 
total_tokens(self)
Return a dict mapping feature names to the number of tokens provided by this resource for each.
 
_get_license_tokens(self)
Populate the tokens table from the license object.
 
_get_server_tokens(self)
Get license usage information from a server via "lmutil lmstat".
 
jobs(self, jobtypes=[])
Return a dict mapping each job type to the number of jobs that can be run given the available tokens.
 
_get_features(self)
Get license feature information via "lmutil lmdiag".
 
_check_features(self)
Check the results returned from lmdiag and record errors if there are expired fatures, or similar problems.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  job_reqs = {}
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, location, source=None)
(Constructor)

 

The location may be either a pathname or the port@host address of a license server. The source should be the name of the environment variable that specified this resource, or the pathname of the directory where it was found.

Overrides: object.__init__

__repr__(self)
(Representation operator)

 

repr(x)

Overrides: object.__repr__
(inherited documentation)

_load_tokens(self)

 

Load the information about the total number of tokens available and the number currently in use. For server based licenses, this will query the server.

The info is recorded in the tokens attribute, a dict that maps feature names to stat_info tuples.

_get_server_tokens(self)

 

Get license usage information from a server via "lmutil lmstat".

A dict mapping the token name to a named tuple recording the total tokens provided by this resource and the number currently check out.

_get_features(self)

 

Get license feature information via "lmutil lmdiag".

A dict mapping the feature name to a a list of LicenseFeature objects for that feature is returned.