diff options
author | Sol Jerome <solj@ices.utexas.edu> | 2010-03-05 22:04:30 +0000 |
---|---|---|
committer | Sol Jerome <solj@ices.utexas.edu> | 2010-03-05 22:04:30 +0000 |
commit | 9cf6153077173957ae04988216ba0b57406aa1b8 (patch) | |
tree | 53f19b0e3560e0daea29c74b4c57ee1fdf99c8b4 /tools/posixunified.py | |
parent | 8f7b3be12d0ca5872a8a4d1e240acff8bd364762 (diff) | |
download | bcfg2-9cf6153077173957ae04988216ba0b57406aa1b8.tar.gz bcfg2-9cf6153077173957ae04988216ba0b57406aa1b8.tar.bz2 bcfg2-9cf6153077173957ae04988216ba0b57406aa1b8.zip |
posixunified: Add patch for BoundEntries from Eric McDonald
Signed-off-by: Sol Jerome <solj@ices.utexas.edu>
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5750 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'tools/posixunified.py')
-rw-r--r-- | tools/posixunified.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/posixunified.py b/tools/posixunified.py index b631fb05c..f73e7703c 100644 --- a/tools/posixunified.py +++ b/tools/posixunified.py @@ -39,6 +39,15 @@ if __name__ == '__main__': newd = deepcopy(d) newd.set('type', 'directory') rulesroot.append(newd) + # replace BoundDirectory elements + for d in xdata.findall('//BoundDirectory'): + parent = d.getparent() + oldd = d + d.tag = 'BoundPath' + parent.replace(oldd, d) + # Create new-style entry + newd = deepcopy(d) + newd.set('type', 'directory') # replace Permissions elements for p in xdata.findall('//Permissions'): parent = p.getparent() @@ -49,6 +58,15 @@ if __name__ == '__main__': newp = deepcopy(p) newp.set('type', 'permissions') rulesroot.append(newp) + # replace BoundPermissions elements + for p in xdata.findall('//BoundPermissions'): + parent = p.getparent() + oldp = p + p.tag = 'BoundPath' + parent.replace(oldp, p) + # Create new-style entry + newp = deepcopy(p) + newp.set('type', 'permissions') # replace SymLink elements for s in xdata.findall('//SymLink'): parent = s.getparent() @@ -59,6 +77,15 @@ if __name__ == '__main__': news = deepcopy(s) news.set('type', 'symlink') rulesroot.append(news) + # replace BoundSymLink elements + for s in xdata.findall('//BoundSymLink'): + parent = s.getparent() + olds = s + s.tag = 'BoundPath' + parent.replace(olds, s) + # Create new-style entry + news = deepcopy(s) + news.set('type', 'symlink') # write out the new bundle try: newbundle = open("%s/%s/new%s" % (repo, plug, filename), 'w') |