From d45f6d05a3c4d88177813d3df567fe219b8fdfad Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Mon, 7 Sep 2009 21:15:05 +0000 Subject: Compat: Fix plugin to generate proper spec for older clients Signed-off-by: Sol Jerome git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5418 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Plugins/Compat.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/lib') diff --git a/src/lib/Server/Plugins/Compat.py b/src/lib/Server/Plugins/Compat.py index 8e3aa7102..f381fe982 100644 --- a/src/lib/Server/Plugins/Compat.py +++ b/src/lib/Server/Plugins/Compat.py @@ -6,11 +6,13 @@ __revision__ = '$Revision$' import Bcfg2.Server.Plugin -COMPAT_DICT = {'configfile': 'ConfigFile', - 'device': 'Device', - 'directory': 'Directory', - 'permissions': 'Permissions', - 'symlink': 'SymLink'} +# FIXME: We will need this mapping if we decide to change the +# specification to use lowercase types for new POSIX entry types +#COMPAT_DICT = {'configfile': 'ConfigFile', +# 'device': 'Device', +# 'directory': 'Directory', +# 'permissions': 'Permissions', +# 'symlink': 'SymLink'} class Compat(Bcfg2.Server.Plugin.Plugin, Bcfg2.Server.Plugin.GoalValidator): @@ -27,6 +29,8 @@ class Compat(Bcfg2.Server.Plugin.Plugin, for entry in goal.getchildren(): if entry.tag == 'Path': oldentry = entry - entry.tag = COMPAT_DICT['%s' % entry.get('type')] - entry.set('type', 'Compat') + entry.tag = entry.get('type') + # FIXME: use another attribute? old clients only + # know about type=None + #entry.set('type', 'Compat') goal.replace(oldentry, entry) -- cgit v1.2.3-1-g7c22