summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Cfg/CfgLegacyInfo.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/Cfg/CfgLegacyInfo.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/Cfg/CfgLegacyInfo.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Cfg/CfgLegacyInfo.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Cfg/CfgLegacyInfo.py b/src/lib/Bcfg2/Server/Plugins/Cfg/CfgLegacyInfo.py
index a47663904..8f71c45c8 100644
--- a/src/lib/Bcfg2/Server/Plugins/Cfg/CfgLegacyInfo.py
+++ b/src/lib/Bcfg2/Server/Plugins/Cfg/CfgLegacyInfo.py
@@ -4,7 +4,8 @@ import logging
import Bcfg2.Server.Plugin
from Bcfg2.Server.Plugins.Cfg import CfgInfo
-logger = logging.getLogger(__name__)
+LOGGER = logging.getLogger(__name__)
+
class CfgLegacyInfo(CfgInfo):
""" CfgLegacyInfo handles :file:`info` and :file:`:info` files for
@@ -20,6 +21,9 @@ class CfgLegacyInfo(CfgInfo):
def __init__(self, path):
CfgInfo.__init__(self, path)
self.path = path
+
+ #: The set of info metadata stored in the file
+ self.metadata = None
__init__.__doc__ = CfgInfo.__init__.__doc__
def bind_info_to_entry(self, entry, metadata):
@@ -30,9 +34,10 @@ class CfgLegacyInfo(CfgInfo):
if event.code2str() == 'deleted':
return
for line in open(self.path).readlines():
- match = Bcfg2.Server.Plugin.info_regex.match(line)
+ match = Bcfg2.Server.Plugin.INFO_REGEX.match(line)
if not match:
- logger.warning("Failed to parse line in %s: %s" % (fpath, line))
+ LOGGER.warning("Failed to parse line in %s: %s" %
+ (event.filename, line))
continue
else:
self.metadata = \