summaryrefslogtreecommitdiffstats
path: root/rteval
diff options
context:
space:
mode:
authorDavid Sommerseth <davids@redhat.com>2013-01-04 17:29:06 +0100
committerDavid Sommerseth <davids@redhat.com>2013-01-04 17:29:06 +0100
commit8c7477a341863b760c7f4d1064d3d964049bc993 (patch)
tree502177e329d1753b624c92c7d3cb745bbde30018 /rteval
parent6ffd077bbfd47532ae4d5509602eea5f51fbf96d (diff)
downloadrteval-8c7477a341863b760c7f4d1064d3d964049bc993.tar.gz
rteval-8c7477a341863b760c7f4d1064d3d964049bc993.tar.xz
rteval-8c7477a341863b760c7f4d1064d3d964049bc993.zip
Move the configuration defaults from rteval-cmd and into the rtevalConfig module
This is to make it easier to apply default values when importing the rteval module from other places than rteval-cmd. Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'rteval')
-rw-r--r--rteval/rtevalConfig.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/rteval/rtevalConfig.py b/rteval/rtevalConfig.py
index 6df3dc2..1bf4a42 100644
--- a/rteval/rtevalConfig.py
+++ b/rteval/rtevalConfig.py
@@ -34,6 +34,26 @@ import os
import ConfigParser
from Log import Log
+default_config = {
+ 'rteval': {
+ 'quiet' : False,
+ 'verbose' : False,
+ 'keepdata' : True,
+ 'debugging' : False,
+ 'duration' : '60',
+ 'sysreport' : False,
+ 'reportdir' : None,
+ 'reportfile' : None,
+ 'workdir' : os.getcwd(),
+ 'installdir' : '/usr/share/rteval',
+ 'srcdir' : '/usr/share/rteval/loadsource',
+ 'xmlrpc' : None,
+ 'xslt_report': '/usr/share/rteval/rteval_text.xsl',
+ 'report_interval': '600',
+ 'logging' : False,
+ }
+ }
+
class rtevalCfgSection(object):
def __init__(self, section_cfg):
@@ -125,6 +145,11 @@ class rtevalConfig(object):
self.__config_files = []
self.__logger = logger
+ # Import the default config first
+ for sect, vals in default_config.items():
+ self.__update_section(sect, vals)
+
+ # Set the runtime provided init variables
if initvars:
if type(initvars) is not dict:
raise TypeError('initvars argument is not a dict variable')