diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-08-09 11:19:47 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-08-09 11:46:16 -0400 |
commit | 6fedc7a28b21cab6be173ab8ef82113697ab170b (patch) | |
tree | 7b1515bec5f9ea2c1f8546ad7ecb685f9ba2a2d5 /src/lib/Bcfg2/Options/Options.py | |
parent | 86ebb3260c9e1bc77d2f69257576bcbabeba4097 (diff) | |
download | bcfg2-6fedc7a28b21cab6be173ab8ef82113697ab170b.tar.gz bcfg2-6fedc7a28b21cab6be173ab8ef82113697ab170b.tar.bz2 bcfg2-6fedc7a28b21cab6be173ab8ef82113697ab170b.zip |
Options: fix parsing of ComponentActions and other finalizable actions
Diffstat (limited to 'src/lib/Bcfg2/Options/Options.py')
-rw-r--r-- | src/lib/Bcfg2/Options/Options.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/Bcfg2/Options/Options.py b/src/lib/Bcfg2/Options/Options.py index 18e5cc75d..ca0261907 100644 --- a/src/lib/Bcfg2/Options/Options.py +++ b/src/lib/Bcfg2/Options/Options.py @@ -148,7 +148,7 @@ class Option(object): :class:`Bcfg2.Options.OptionGroup` """ return [self] - def finalize(self): + def finalize(self, namespace): """ Finalize the default value for this option. This is used with actions (such as :class:`Bcfg2.Options.ComponentAction`) that allow you to specify a default in a different format than @@ -157,9 +157,8 @@ class Option(object): not given on the command line or in the config file) to store the appropriate default value in the appropriate format.""" for parser, action in self.actions.items(): - if parser is not None: - if hasattr(action, "finalize"): - action.finalize(parser, parser.namespace) + if hasattr(action, "finalize"): + action.finalize(parser, namespace) def from_config(self, cfp): """ Get the value of this option from the given |