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

Module rhnConfig

source code

Classes [hide private]
  ConfigParserError
Exception class we're using to expose fatal errors
  RHNOptions
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.
Functions [hide private]
 
warn(*args)
Function used for debugging purposes
source code
 
parse_comps(component)
Splits a component name (a.b.c) into a list of tuples that can be joined together to determine a config file name Eg.
source code
 
parse_line(line)
Parse a config line...
source code
 
parse_file(filename, single_key=0)
parse a config file (read it in, parse its lines)
source code
 
read_file(filename)
reads a text config file and returns its lines in a list
source code
 
getAllComponents_tree(defaultDir=None)
Figure out all components and return them in a tree-like structure
source code
 
getAllComponents(defaultDir=None, compsTree=None)
recursively flattens the results of getAllComponents_tree returning a list of all components
source code
 
getAllComponents_tuples(defaultDir=None)
returns a list of ALL components in the tuple-ified format: E.g., [(), ('a',), ('a','b'), ('a','b','c'), ...]
source code
 
initCFG(component=None, root=None, filename=None)
Main entry point here
source code
 
runTest() source code
Variables [hide private]
  _CONFIG_ROOT = '/etc/rhn'
  _CONFIG_FILE = '/etc/rhn/rhn.conf'
  _CONFIG_DEFAULTS_ROOT = '/usr/share/rhn/config-defaults'
  CFG = <RHNOptions instance at 139980826311928: Uninitialized>
  ALL_CFG = <RHNOptions instance at 139980826312000: Uninitialized>
  PRODUCT_NAME = 'Spacewalk'
  __package__ = 'backend.common'
Function Details [hide private]

parse_comps(component)

source code 

Splits a component name (a.b.c) into a list of tuples that can be joined together to determine a config file name Eg. a.b.c --> [(), ('a',), ('a','b'), ('a','b','c')]

parse_line(line)

source code 

Parse a config line... Returns a tuple (keys, values), or (None, None) if we don't care about this line

getAllComponents_tree(defaultDir=None)

source code 
Figure out all components and return them in a tree-like structure

{'server', {'server.app':{},
            'server.satellite':{},
            'server.applet':{}, 'server.bugzilla':{},
            'server.iss':{}, 'server.xmlrpc':{}, 'server.xp':{}},
 'web': {},
 'tools': {}}

NOTE: this was begging for recursion... I avoided that like the plague