diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-05-22 11:30:20 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-05-22 11:30:20 -0400 |
commit | b0877561d20cdb7a21c5761428d9643e89f53773 (patch) | |
tree | 86551b4655c4af8b58d2ab29a61f54f039b616ba /tools | |
parent | 080536f7ae475c755a1c021b83ec445d09e18aff (diff) | |
download | bcfg2-b0877561d20cdb7a21c5761428d9643e89f53773.tar.gz bcfg2-b0877561d20cdb7a21c5761428d9643e89f53773.tar.bz2 bcfg2-b0877561d20cdb7a21c5761428d9643e89f53773.zip |
tools: make migrate_info.py migrate "perms" (http://trac.mcs.anl.gov/projects/bcfg2/ticket/1150)
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/upgrade/1.3/migrate_info.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/upgrade/1.3/migrate_info.py b/tools/upgrade/1.3/migrate_info.py index e72599daf..3ccbf0285 100755 --- a/tools/upgrade/1.3/migrate_info.py +++ b/tools/upgrade/1.3/migrate_info.py @@ -1,12 +1,16 @@ #!/usr/bin/env python import os +import re import sys import lxml.etree import Bcfg2.Options from Bcfg2.Server.Plugin import INFO_REGEX +PERMS_REGEX = re.compile(r'perms:\s*(?P<perms>\w+)') + + def convert(info_file): info_xml = os.path.join(os.path.dirname(info_file), "info.xml") if os.path.exists(info_xml): @@ -16,7 +20,7 @@ def convert(info_file): fileinfo = lxml.etree.Element("FileInfo") info = lxml.etree.SubElement(fileinfo, "Info") for line in open(info_file).readlines(): - match = INFO_REGEX.match(line) + match = INFO_REGEX.match(line) or PERMS_REGEX.match(line) if match: mgd = match.groupdict() for key, value in list(mgd.items()): |