summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/Bcfg2/Server/Plugin/helpers.py5
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py13
2 files changed, 9 insertions, 9 deletions
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