summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins/Snapshots.py
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2009-10-07 14:46:08 +0000
committerSol Jerome <solj@ices.utexas.edu>2009-10-07 14:46:08 +0000
commiteac52c270b8b3b10e461bc46502b64c5f898bd7d (patch)
tree96da2e78af41305b445de23596b75bf754eedbbc /src/lib/Server/Plugins/Snapshots.py
parente686d3b69600441e943c2913542e5477af528d87 (diff)
downloadbcfg2-eac52c270b8b3b10e461bc46502b64c5f898bd7d.tar.gz
bcfg2-eac52c270b8b3b10e461bc46502b64c5f898bd7d.tar.bz2
bcfg2-eac52c270b8b3b10e461bc46502b64c5f898bd7d.zip
Pylint/PEP 8 Code cleanups
Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5477 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Plugins/Snapshots.py')
-rw-r--r--src/lib/Server/Plugins/Snapshots.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/Server/Plugins/Snapshots.py b/src/lib/Server/Plugins/Snapshots.py
index 3b2949e7a..871d77b68 100644
--- a/src/lib/Server/Plugins/Snapshots.py
+++ b/src/lib/Server/Plugins/Snapshots.py
@@ -15,6 +15,7 @@ datafields = {'Package': ['version'],
'Service': ['status'],
'ConfigFile': ['owner', 'group', 'perms']}
+
def build_snap_ent(entry):
basefields = []
if entry.tag in ['Package', 'Service']:
@@ -39,17 +40,19 @@ def build_snap_ent(entry):
diff = binascii.a2b_base64(entry.get('current_bdiff'))
state['contents'] = unicode( \
'\n'.join(difflib.restore(diff.split('\n'), 1)))
-
+
state.update([(key, unicode(entry.get('current_' + key, entry.get(key)))) \
for key in datafields[entry.tag]])
if entry.tag == 'ConfigFile' and entry.get('exists', 'true') == 'false':
state = None
return [desired, state]
+
class Snapshots(Bcfg2.Server.Plugin.Statistics,
Bcfg2.Server.Plugin.Plugin):
name = 'Snapshots'
experimental = True
+
def __init__(self, core, datastore):
Bcfg2.Server.Plugin.Plugin.__init__(self, core, datastore)
Bcfg2.Server.Plugin.Statistics.__init__(self)