Package backend :: Package common :: Module rhnConfig :: Class RHNOptions
[hide private]
[frames] | no frames]

Class RHNOptions

source code

Main options class The basic idea is to share the important pieces of information - the component and the configuration tree - across all instances of this class.

Instance Methods [hide private]
 
__init__(self, component=None, root=None, filename=None) source code
 
init(self, component, root=None, filename=None)
Visible function, so that we can re-init the object without losing the reference to it
source code
 
setComponent(self, comp) source code
 
getComponent(self) source code
 
is_initialized(self) source code
 
modifiedYN(self)
returns last modified time diff if rhn.conf has changed.
source code
 
updateLastModified(self, timeDiff=None)
update the last modified time of the rhn.conf file.
source code
 
parse(self)
This function parses the config file, if needed, and populates the configuration cache self.__configs
source code
 
_parseDefaults(self, allCompsYN=0)
Parsing of the /usr/share/rhn/config-defaults/*.conf (or equivalent) Make sure we have all the needed default config files loaded We store the defaults in a dictionary, keyed on the component tuple
source code
 
keys(self) source code
 
has_key(self, key) source code
 
values(self) source code
 
items(self) source code
 
set(self, key, value) source code
 
__setitem__(self, key, value) source code
 
show(self) source code
 
__getattr__(self, key)
fetch option you want in a self.DEBUG kind of syntax (can force component selection)
source code
 
__getitem__(self, key)
fetch option you want in a self.DEBUG kind of syntax (can force component selection)
source code
 
get(self, key, default=None) source code
 
__str__(self) source code
 
__repr__(self) source code
 
__check(self) source code
 
__merge(self, component=None)
merge the config options between the default comp dictionaries and the file we're parsing now
source code
 
getDefaults(self)
returns the __defaults dict (dictionary of parsed defaults).
source code
 
_getParsedConfig(self)
returns the __parsedConfig dict (dictionary of parsed /etc/rhn/rhn.conf file).
source code
 
_getConfigs(self)
returns the __configs dict (dictionary of the merged options keyed by component.
source code
 
showall(self) source code
Method Details [hide private]

__getattr__(self, key)
(Qualification operator)

source code 
fetch option you want in a self.DEBUG kind of syntax
   (can force component selection)

e.g.: say for example we have an option proxy.debug = 5
      stored in the dictionary. proxy just says that only proxy
      can access this option. So for this exmple,
      self.__component is proxy.
       cfg = RHNOptions("proxy")
       print cfg.DEBUG ---> yields 5

__getitem__(self, key)
(Indexing operator)

source code 
fetch option you want in a self.DEBUG kind of syntax
   (can force component selection)

e.g.: say for example we have an option proxy.debug = 5
      stored in the dictionary. proxy just says that only proxy
      can access this option. So for this exmple,
      self.__component is proxy.
       cfg = RHNOptions("proxy")
       print cfg.DEBUG ---> yields 5