Package ClusterShell :: Module NodeUtils :: Class YAMLGroupLoader
[hide private]
[frames] | no frames]

Class YAMLGroupLoader

source code



YAML group file loader/reloader.

Load or reload a YAML multi group sources file:

- create GroupSource objects
- gather groups dict content on load
- reload the file once cache_time has expired

Instance Methods [hide private]
 
__init__(self, filename, cache_time=None)
Initialize YAMLGroupLoader and load file.
source code
 
_load(self)
Load or reload YAML group file to create GroupSource objects.
source code
 
__iter__(self)
Iterate over GroupSource objects.
source code
 
groups(self, sourcename)
Groups dict accessor for sourcename.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, filename, cache_time=None)
(Constructor)

source code 

Initialize YAMLGroupLoader and load file.

:param filename: YAML file path :param cache_time: cache time (seconds)

Overrides: object.__init__

groups(self, sourcename)

source code 

Groups dict accessor for sourcename.

This method is called by associated FileGroupSource objects and simply returns dict content, after reloading file if cache_time has expired.