From c2133f115673670992048f3567c22e7478281a79 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Fri, 18 Jan 2013 11:06:41 -0500 Subject: StructFile: fixed lax/strict decryption setting with no crypto libs installed --- src/lib/Bcfg2/Server/Plugin/helpers.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/lib/Bcfg2/Server/Plugin') diff --git a/src/lib/Bcfg2/Server/Plugin/helpers.py b/src/lib/Bcfg2/Server/Plugin/helpers.py index 399ab6679..b036fc31d 100644 --- a/src/lib/Bcfg2/Server/Plugin/helpers.py +++ b/src/lib/Bcfg2/Server/Plugin/helpers.py @@ -598,15 +598,12 @@ class StructFile(XMLFileBacked): def Index(self): XMLFileBacked.Index(self) - if self.encryption: + if self.encryption and HAS_CRYPTO: strict = self.xdata.get( "decrypt", self.setup.cfp.get(Bcfg2.Encryption.CFG_SECTION, "decrypt", default="strict")) == "strict" for el in self.xdata.xpath("//*[@encrypted]"): - if not HAS_CRYPTO: - raise PluginExecutionError("%s: M2Crypto is not available" - % self.name) try: el.text = self._decrypt(el).encode('ascii', 'xmlcharrefreplace') -- cgit v1.2.3-1-g7c22