Package gofer :: Package agent :: Module config :: Class Config
[hide private]
[frames] | no frames]

Class Config

source code

                     object --+            
                              |            
iniparse.config.ConfigNamespace --+        
                                  |        
             iniparse.ini.INIConfig --+    
                                      |    
                                   Base --+
                                          |
                                         Config

The gofer agent configuration.

Nested Classes [hide private]
  __metaclass__
Singleton metaclass usage: __metaclass__ = Singleton
Instance Methods [hide private]
 
__init__(self)
Open the configuration.
source code
Config
__update(self, other)
Update with the specified other configuration.
source code
Config
__mergeIn(self, other)
Merge (in) the specified other configuration.
source code
Config
__mergeOut(self, other)
Merge (out) to the specified other configuration.
source code
 
write(self)
Write the configuration.
source code
str
__altpath(self)
Get the alternate configuration path.
source code
 
__addconfd(self)
Read and merge the conf.d files.
source code

Inherited from iniparse.ini.INIConfig: __delitem__, __iter__, __setitem__, __str__, __unicode__

Inherited from iniparse.ini.INIConfig (private): _getitem, _new_namespace, _parse, _readfp

Inherited from iniparse.config.ConfigNamespace: __contains__, __delattr__, __getattr__, __getitem__, __setattr__, __setstate__

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

Class Variables [hide private]
str ROOT = '/etc/gofer'
The root configuration directory.
  FILE = 'agent.conf'
str PATH = '/etc/gofer/agent.conf'
The absolute path to the config directory.
str USER = '~/.gofer/agent.conf'
The path to an alternate configuration file within the user's home.
  CNFD = '/etc/gofer/conf.d'
str ALT = 'GOFER_OVERRIDE'
The environment variable with a path to an alternate configuration file.

Inherited from iniparse.ini.INIConfig (private): _bom, _data, _defaults, _line_types, _optionxformsource, _optionxformvalue, _parse_exc, _sections, _sectionxformsource, _sectionxformvalue

Properties [hide private]

Inherited from iniparse.ini.INIConfig (private): _optionxform, _sectionxform

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Open the configuration. Merge (in) alternate configuration file when specified by environment variable.

Parameters:
  • path - The path to an INI file.
Overrides: object.__init__

__update(self, other)

source code 

Update with the specified other configuration.

Parameters:
  • other (Base) - The conf to update with.
Returns: Config
self

__mergeIn(self, other)

source code 

Merge (in) the specified other configuration.

Parameters:
  • other (Base) - The conf to merge in.
Returns: Config
self

__mergeOut(self, other)

source code 

Merge (out) to the specified other configuration.

Parameters:
  • other (Base) - The conf to merge out.
Returns: Config
self

__altpath(self)

source code 

Get the alternate configuration path. Resolution order: ALT, USER

Returns: str
The path to the alternate configuration file.