summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Options
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-11-12 15:35:12 -0500
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-11-12 15:35:12 -0500
commit2b6824857c4ab80e3e791edf82aee3e75e037316 (patch)
treedfa4cd5100fc37928042c18b8934dc7316ee3a8d /src/lib/Bcfg2/Options
parent42d5dc73018de354c598c63d584525e0cc77bc9b (diff)
downloadbcfg2-2b6824857c4ab80e3e791edf82aee3e75e037316.tar.gz
bcfg2-2b6824857c4ab80e3e791edf82aee3e75e037316.tar.bz2
bcfg2-2b6824857c4ab80e3e791edf82aee3e75e037316.zip
Options: made unit test flag public
Diffstat (limited to 'src/lib/Bcfg2/Options')
-rw-r--r--src/lib/Bcfg2/Options/Parser.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/Bcfg2/Options/Parser.py b/src/lib/Bcfg2/Options/Parser.py
index d7550e123..b672aebb9 100644
--- a/src/lib/Bcfg2/Options/Parser.py
+++ b/src/lib/Bcfg2/Options/Parser.py
@@ -48,7 +48,7 @@ class Parser(argparse.ArgumentParser):
cf=('components', 'encoding'))]
#: Flag used in unit tests to disable actual config file reads
- _unit_test = False
+ unit_test = False
def __init__(self, **kwargs):
""" See :class:`argparse.ArgumentParser` for a full list of
@@ -212,7 +212,7 @@ class Parser(argparse.ArgumentParser):
bootstrap = bootstrap_parser.parse_known_args(args=self.argv)[0]
# check whether the specified bcfg2.conf exists
- if not self._unit_test and not os.path.exists(bootstrap.config):
+ if not self.unit_test and not os.path.exists(bootstrap.config):
self.error("Could not read %s" % bootstrap.config)
self.add_config_file(self.configfile.dest, bootstrap.config,
reparse=False)
@@ -297,7 +297,7 @@ def get_parser(description=None, components=None, namespace=None):
:type namespace: argparse.Namespace
:returns: Bcfg2.Options.Parser object
"""
- if Parser._unit_test:
+ if Parser.unit_test:
return Parser(description=description, components=components,
namespace=namespace)
elif (description or components or namespace):