summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins/Snapshots.py
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2009-11-19 05:25:25 +0000
committerSol Jerome <solj@ices.utexas.edu>2009-11-19 05:25:25 +0000
commitddc74a543f53d4197e990def51628f961af5b8cd (patch)
treee432e743fff65d7342bce7e47f07a99a9ec4f899 /src/lib/Server/Plugins/Snapshots.py
parent18f8668b60cea58fa26ae96c81e201e321547e1a (diff)
downloadbcfg2-ddc74a543f53d4197e990def51628f961af5b8cd.tar.gz
bcfg2-ddc74a543f53d4197e990def51628f961af5b8cd.tar.bz2
bcfg2-ddc74a543f53d4197e990def51628f961af5b8cd.zip
POSIX: Remove support for old-style posix entries
This commit forces the user to specify <Path> entries on the server side while still maintaining compatibility with old clients via the POSIXCompat plugin. Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5582 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Plugins/Snapshots.py')
-rw-r--r--src/lib/Server/Plugins/Snapshots.py23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/lib/Server/Plugins/Snapshots.py b/src/lib/Server/Plugins/Snapshots.py
index b71f085d9..0da9f6ffc 100644
--- a/src/lib/Server/Plugins/Snapshots.py
+++ b/src/lib/Server/Plugins/Snapshots.py
@@ -14,12 +14,11 @@ import threading
logger = logging.getLogger('Snapshots')
-ftypes = ['ConfigFile', 'SymLink', 'Directory']
-datafields = {'Package': ['version'],
+datafields = {
+ 'Package': ['version'],
+ 'Path': ['type'],
'Service': ['status'],
- 'ConfigFile': ['owner', 'group', 'perms'],
- 'Directory': ['owner', 'group', 'perms'],
- 'SymLink': ['to']}
+ }
def build_snap_ent(entry):
basefields = []
@@ -29,7 +28,7 @@ def build_snap_ent(entry):
state = dict([(key, unicode(entry.get(key))) for key in basefields])
desired.update([(key, unicode(entry.get(key))) for key in \
datafields[entry.tag]])
- if entry.tag == 'ConfigFile':
+ if (entry.tag == 'Path') and (entry.get('type') == 'file'):
if entry.text == None:
desired['contents'] = None
else:
@@ -48,7 +47,7 @@ def build_snap_ent(entry):
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':
+ if entry.tag == 'Path' and entry.get('exists', 'true') == 'false':
state = None
return [desired, state]
@@ -92,16 +91,10 @@ class Snapshots(Bcfg2.Server.Plugin.Statistics,
for entry in state.find('.//Bad'):
data = [False, False, unicode(entry.get('name'))] \
+ build_snap_ent(entry)
- if entry.tag in ftypes:
- etag = 'Path'
- else:
- etag = entry.tag
+ etag = entry.tag
entries[etag][entry.get('name')] = data
for entry in state.find('.//Modified'):
- if entry.tag in ftypes:
- etag = 'Path'
- else:
- etag = entry.tag
+ etag = entry.tag
if entry.get('name') in entries[etag]:
data = [True, False, unicode(entry.get('name'))] + \
build_snap_ent(entry)