rad  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
etr.plugins.resources.LocalResources Class Reference

Acquire/release local resources, as specified by config files. More...

Public Member Functions

def __init__
 
def source
 Returns source as a scheme://path. More...
 
def acquire_resource
 Tries to find matching resource in the specified config file and locks it if found (and not locked). More...
 
def release_resource
 Release resource specified by resource_id. More...
 

Detailed Description

Acquire/release local resources, as specified by config files.

The config schema is as follows:

Version
: "1.0" resources: <resource-id>: type <type> tags:
  • <tag>
  • <tag>

<attributes>

Lockfiles are created in the same directory as the configuration file itself, so it needs to be writable.

A resource is locked if the file <resource-id>.lock exists, where <name> is the configuration name for the resource.

The contents of the file contains information about the lockee.

Constructor & Destructor Documentation

def etr.plugins.resources.LocalResources.__init__ (   self,
  cfgfile 
)

Member Function Documentation

def etr.plugins.resources.LocalResources.acquire_resource (   self,
  type,
  tags = None 
)

Tries to find matching resource in the specified config file and locks it if found (and not locked).

Returns tuple of (resource-id, dict of attributes, msg)

def etr.plugins.resources.LocalResources.release_resource (   self,
  resource_id 
)

Release resource specified by resource_id.

def etr.plugins.resources.LocalResources.source (   self)

Returns source as a scheme://path.


The documentation for this class was generated from the following file: