From da0918e71e82c407e1dc7f5cb80f33cad93263af Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Tue, 13 Aug 2013 09:31:49 -0400 Subject: testsuite: fixed unit tests for new SSLCA stuff --- src/lib/Bcfg2/Server/Plugin/helpers.py | 5 ++++- src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py | 13 +++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/lib/Bcfg2') diff --git a/src/lib/Bcfg2/Server/Plugin/helpers.py b/src/lib/Bcfg2/Server/Plugin/helpers.py index 2d157eba9..b18f1c52d 100644 --- a/src/lib/Bcfg2/Server/Plugin/helpers.py +++ b/src/lib/Bcfg2/Server/Plugin/helpers.py @@ -631,6 +631,9 @@ class StructFile(XMLFileBacked): #: the file being cached __identifier__ = None + #: Whether or not to enable encryption + encryption = True + #: Callbacks used to determine if children of items with the given #: tags should be included in the return value of #: :func:`Bcfg2.Server.Plugin.helpers.StructFile.Match` and @@ -674,7 +677,7 @@ class StructFile(XMLFileBacked): self.logger.error('Genshi parse error in %s: %s' % (self.name, err)) - if HAS_CRYPTO: + if HAS_CRYPTO and self.encryption: lax_decrypt = self.xdata.get( "lax_decryption", str(Bcfg2.Options.setup.lax_decryption)).lower() == "true" diff --git a/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py b/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py index 21dc35e5a..eea0a3456 100644 --- a/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py +++ b/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py @@ -10,7 +10,7 @@ import Bcfg2.Options import Bcfg2.Server.Plugin from Bcfg2.Server.Plugin import PluginExecutionError # pylint: disable=W0622 -from Bcfg2.Compat import u_str, unicode, b64encode, any +from Bcfg2.Compat import u_str, unicode, b64encode, any, walk_packages # pylint: enable=W0622 try: @@ -19,9 +19,12 @@ try: except ImportError: HAS_CRYPTO = False +_handlers = [m[1] # pylint: disable=C0103 + for m in walk_packages(path=__path__)] _CFG = None + def get_cfg(): """ Get the :class:`Bcfg2.Server.Plugins.Cfg.Cfg` plugin object created by the Bcfg2 core. This is provided so that the handler @@ -888,13 +891,7 @@ class Cfg(Bcfg2.Server.Plugin.GroupSpool, cf=("cfg", "handlers"), dest="cfg_handlers", help="Cfg handlers to load", type=Bcfg2.Options.Types.comma_list, action=CfgHandlerAction, - default=['CfgAuthorizedKeysGenerator', 'CfgEncryptedGenerator', - 'CfgCheetahGenerator', 'CfgEncryptedCheetahGenerator', - 'CfgGenshiGenerator', 'CfgEncryptedGenshiGenerator', - 'CfgExternalCommandVerifier', 'CfgInfoXML', - 'CfgPlaintextGenerator', - 'CfgPrivateKeyCreator', 'CfgPublicKeyCreator', - 'CfgSSLCACertCreator', 'CfgSSLCAKeyCreator'])] + default=_handlers)] def __init__(self, core, datastore): global _CFG # pylint: disable=W0603 -- cgit v1.2.3-1-g7c22