diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-09-11 10:32:30 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-09-11 10:32:30 -0400 |
commit | 71c679e1a0105490bd5845a15de5e8f1a32e2166 (patch) | |
tree | c528e62098b599d7ae74ea53908a045ccf2ffb63 /src/lib/Bcfg2/Server/Plugins/Properties.py | |
parent | b682d9e3c11f94a9a9dc254a6d53e44f953a74bf (diff) | |
download | bcfg2-71c679e1a0105490bd5845a15de5e8f1a32e2166.tar.gz bcfg2-71c679e1a0105490bd5845a15de5e8f1a32e2166.tar.bz2 bcfg2-71c679e1a0105490bd5845a15de5e8f1a32e2166.zip |
Cfg: documented all Cfg modules, added development docs
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Properties.py')
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Properties.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Properties.py b/src/lib/Bcfg2/Server/Plugins/Properties.py index 88f075311..8fed8ad96 100644 --- a/src/lib/Bcfg2/Server/Plugins/Properties.py +++ b/src/lib/Bcfg2/Server/Plugins/Properties.py @@ -6,7 +6,7 @@ import logging import lxml.etree import Bcfg2.Server.Plugin try: - from Bcfg2.Encryption import ssl_decrypt, EVPError + from Bcfg2.Encryption import ssl_decrypt, get_passphrases, EVPError have_crypto = True except ImportError: have_crypto = False @@ -15,15 +15,6 @@ logger = logging.getLogger(__name__) SETUP = None -def passphrases(): - section = "encryption" - if SETUP.cfp.has_section(section): - return dict([(o, SETUP.cfp.get(section, o)) - for o in SETUP.cfp.options(section)]) - else: - return dict() - - class PropertyFile(Bcfg2.Server.Plugin.StructFile): """Class for properties files.""" def write(self): @@ -91,7 +82,7 @@ class PropertyFile(Bcfg2.Server.Plugin.StructFile): def _decrypt(self, element): if not element.text.strip(): return - passes = passphrases() + passes = get_passphrases(SETUP) try: passphrase = passes[element.get("encrypted")] try: |