RHNConf - file /etc/rhn/rhn.conf

class insights.parsers.rhn_conf.RHNConf(context)[source]

Bases: LegacyItemAccess, Parser

Class to parse the configuration file rhn.conf.

The special feature of rhn.conf is that values can span multiple lines with each intermediate line ending with a comma.

This parser uses the insights.core.LegacyItemAccess mix-in to provide access to its data directly.

data

A dictionary of values keyed by the configuration item. Values spanning multiple lines are compacted together. Values that include a comma are turned into lists.

Type:

dict

Sample rhn.conf input:

# Corporate gateway (hostname:PORT):
server.satellite.http_proxy = corporate_gateway.example.com:8080
server.satellite.http_proxy_username =
server.satellite.http_proxy_password =
traceback_mail = test@example.com, test@redhat.com

web.default_taskmaster_tasks = RHN::Task::SessionCleanup,
                               RHN::Task::ErrataQueue,
                               RHN::Task::ErrataEngine,
                               RHN::Task::DailySummary,
                               RHN::Task::SummaryPopulation,
                               RHN::Task::RHNProc,
                               RHN::Task::PackageCleanup

Examples

>>> conf = shared[RHNConf]
>>> conf.data['server.satellite.http_proxy']  # Long form access
'corporate_gateway.example.com:8080'
>>> conf['server.satellite.http_proxy']  # Short form access
'corporate_gateway.example.com:8080'
>>> conf['traceback_mail']  # split into a list
['test@example.com', 'test@redhat.com']
>>> conf['web.default_taskmaster_tasks'][3]  # Values can span multiple lines
'RHN::Task::DailySummary'
parse_content(content)[source]

This method must be implemented by classes based on this class.