summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Properties.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-09-21 13:55:05 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-09-25 11:58:47 -0400
commitdd28e90f183972cc2a395094ce3e3f72e861953f (patch)
treedfe10fd66e0535763d953333ed49f6467762fbd6 /src/lib/Bcfg2/Server/Plugins/Properties.py
parenteec8f653c0235bde8d3a754802a4485f0d542ea3 (diff)
downloadbcfg2-dd28e90f183972cc2a395094ce3e3f72e861953f.tar.gz
bcfg2-dd28e90f183972cc2a395094ce3e3f72e861953f.tar.bz2
bcfg2-dd28e90f183972cc2a395094ce3e3f72e861953f.zip
run pylint for errors on almost everything, full runs on some selected stuff
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Properties.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Properties.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Properties.py b/src/lib/Bcfg2/Server/Plugins/Properties.py
index 590d536a9..1d5bdbcfc 100644
--- a/src/lib/Bcfg2/Server/Plugins/Properties.py
+++ b/src/lib/Bcfg2/Server/Plugins/Properties.py
@@ -1,3 +1,6 @@
+""" The properties plugin maps property files into client metadata
+instances. """
+
import os
import re
import sys
@@ -89,6 +92,7 @@ class PropertyFile(Bcfg2.Server.Plugin.StructFile):
raise PluginExecutionError(msg)
def _decrypt(self, element):
+ """ Decrypt a single encrypted properties file element """
if not element.text.strip():
return
passes = get_passphrases(SETUP)
@@ -108,6 +112,7 @@ class PropertyFile(Bcfg2.Server.Plugin.StructFile):
class PropDirectoryBacked(Bcfg2.Server.Plugin.DirectoryBacked):
+ """ A collection of properties files """
__child__ = PropertyFile
patterns = re.compile(r'.*\.xml$')
ignore = re.compile(r'.*\.xsd$')
@@ -115,22 +120,20 @@ class PropDirectoryBacked(Bcfg2.Server.Plugin.DirectoryBacked):
class Properties(Bcfg2.Server.Plugin.Plugin,
Bcfg2.Server.Plugin.Connector):
- """
- The properties plugin maps property
- files into client metadata instances.
- """
+ """ The properties plugin maps property files into client metadata
+ instances. """
name = 'Properties'
def __init__(self, core, datastore):
- global SETUP
+ global SETUP # pylint: disable=W0603
Bcfg2.Server.Plugin.Plugin.__init__(self, core, datastore)
Bcfg2.Server.Plugin.Connector.__init__(self)
try:
self.store = PropDirectoryBacked(self.data, core.fam)
except OSError:
- e = sys.exc_info()[1]
- self.logger.error("Error while creating Properties store: %s %s" %
- (e.strerror, e.filename))
+ err = sys.exc_info()[1]
+ self.logger.error("Error while creating Properties store: %s" %
+ err)
raise Bcfg2.Server.Plugin.PluginInitError
SETUP = core.setup