diff options
author | Sol Jerome <solj@ices.utexas.edu> | 2009-10-01 16:47:07 +0000 |
---|---|---|
committer | Sol Jerome <solj@ices.utexas.edu> | 2009-10-01 16:47:07 +0000 |
commit | 3cd34d135d6f3705862f0d1625c06a1669ec0023 (patch) | |
tree | 59b2318ff469544f85d568b2bfac5a4d113e6fc7 /src/lib/Server | |
parent | 3b729603e422786b9d44fee50f2ec255503d1d43 (diff) | |
download | bcfg2-3cd34d135d6f3705862f0d1625c06a1669ec0023.tar.gz bcfg2-3cd34d135d6f3705862f0d1625c06a1669ec0023.tar.bz2 bcfg2-3cd34d135d6f3705862f0d1625c06a1669ec0023.zip |
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 <solj@ices.utexas.edu>
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5470 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server')
-rw-r--r-- | src/lib/Server/Plugins/POSIXCompat.py | 16 |
1 files changed, 9 insertions, 7 deletions
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 |