From 3cd34d135d6f3705862f0d1625c06a1669ec0023 Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Thu, 1 Oct 2009 16:47:07 +0000 Subject: POSIX: Add block/character/fifo devices (ticket #477) This commit adds support for posix device types via Path entries in Bundler. The 'type' attribute for Path entries is now all lowercase. Signed-off-by: Sol Jerome git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5470 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Plugins/POSIXCompat.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/lib/Server') diff --git a/src/lib/Server/Plugins/POSIXCompat.py b/src/lib/Server/Plugins/POSIXCompat.py index 00fdbf65c..d2e530407 100644 --- a/src/lib/Server/Plugins/POSIXCompat.py +++ b/src/lib/Server/Plugins/POSIXCompat.py @@ -8,11 +8,12 @@ import Bcfg2.Server.Plugin # 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'} +COMPAT_DICT = {'configfile': 'ConfigFile', + 'device': 'device', + 'directory': 'Directory', + 'nonexistent': 'nonexistent', + 'permissions': 'Permissions', + 'symlink': 'SymLink'} class POSIXCompat(Bcfg2.Server.Plugin.Plugin, Bcfg2.Server.Plugin.GoalValidator): @@ -27,9 +28,10 @@ class POSIXCompat(Bcfg2.Server.Plugin.Plugin, def validate_goals(self, metadata, goals): for goal in goals: for entry in goal.getchildren(): - if entry.tag == 'Path' and entry.get('type') != 'nonexistent': + if entry.tag == 'Path' and \ + entry.get('type') not in ['nonexistent', 'device']: oldentry = entry - entry.tag = entry.get('type') + entry.tag = COMPAT_DICT[entry.get('type')] del entry.attrib['type'] # FIXME: use another attribute? old clients only # know about type=None -- cgit v1.2.3-1-g7c22