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... | |
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... | |
Acquire/release local resources, as specified by config files.
The config schema is as follows:
<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.
def etr.plugins.resources.LocalResources.__init__ | ( | self, | |
cfgfile | |||
) |
def etr.plugins.resources.LocalResources.__init__ | ( | self, | |
cfgfile | |||
) |
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.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.release_resource | ( | self, | |
resource_id | |||
) |
Release resource specified by resource_id
.
def etr.plugins.resources.LocalResources.source | ( | self | ) |
Returns source as a scheme://path.
def etr.plugins.resources.LocalResources.source | ( | self | ) |
Returns source as a scheme://path.