diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-02-20 10:38:38 -0500 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-02-20 10:38:38 -0500 |
commit | 69ebf49d54aac70a42142d0d04e562496bce58ea (patch) | |
tree | ad0f346ff95a14ad49440128ff76d7e2b3f0816a /src/lib/Bcfg2/Server/Plugins/Defaults.py | |
parent | 602ba6af6bd1c9b3910940dee766660ab8e81a19 (diff) | |
parent | e17e41dcff096ead7e129a0db063f75de44aaa2b (diff) | |
download | bcfg2-69ebf49d54aac70a42142d0d04e562496bce58ea.tar.gz bcfg2-69ebf49d54aac70a42142d0d04e562496bce58ea.tar.bz2 bcfg2-69ebf49d54aac70a42142d0d04e562496bce58ea.zip |
Merge branch 'master' into 1.4.x
Conflicts:
doc/appendix/contributors.txt
schemas/bundle.xsd
src/lib/Bcfg2/Client/Tools/__init__.py
src/lib/Bcfg2/Server/Encryption.py
src/lib/Bcfg2/Server/Lint/Genshi.py
src/lib/Bcfg2/Server/Plugins/Bundler.py
src/lib/Bcfg2/Server/Plugins/Decisions.py
src/lib/Bcfg2/Server/Plugins/TemplateHelper.py
src/sbin/bcfg2-test
testsuite/Testsrc/Testlib/TestClient/TestTools/TestPOSIX/Test__init.py
testsuite/Testsrc/Testlib/TestClient/TestTools/TestPOSIXUsers.py
testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py
testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProperties.py
tools/bcfg2-profile-templates.py
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Defaults.py')
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Defaults.py | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Defaults.py b/src/lib/Bcfg2/Server/Plugins/Defaults.py index f4d86a64f..04c14aa96 100644 --- a/src/lib/Bcfg2/Server/Plugins/Defaults.py +++ b/src/lib/Bcfg2/Server/Plugins/Defaults.py @@ -5,7 +5,7 @@ import Bcfg2.Server.Plugins.Rules class Defaults(Bcfg2.Server.Plugins.Rules.Rules, - Bcfg2.Server.Plugin.StructureValidator): + Bcfg2.Server.Plugin.GoalValidator): """Set default attributes on bound entries""" __author__ = 'bcfg-dev@mcs.anl.gov' @@ -22,27 +22,18 @@ class Defaults(Bcfg2.Server.Plugins.Rules.Rules, def HandleEvent(self, event): Bcfg2.Server.Plugin.XMLDirectoryBacked.HandleEvent(self, event) - def validate_structures(self, metadata, structures): + def validate_goals(self, metadata, config): """ Apply defaults """ - for struct in structures: + for struct in config.getchildren(): for entry in struct.getchildren(): - if entry.tag.startswith("Bound"): - is_bound = True - entry.tag = entry.tag[5:] - else: - is_bound = False try: - try: - self.BindEntry(entry, metadata) - except Bcfg2.Server.Plugin.PluginExecutionError: - # either no matching defaults (which is okay), - # or multiple matching defaults (which is not - # okay, but is logged). either way, we don't - # care about the error. - pass - finally: - if is_bound: - entry.tag = "Bound" + entry.tag + self.BindEntry(entry, metadata) + except Bcfg2.Server.Plugin.PluginExecutionError: + # either no matching defaults (which is okay), + # or multiple matching defaults (which is not + # okay, but is logged). either way, we don't + # care about the error. + pass @property def _regex_enabled(self): |