diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/upgrade/1.3/migrate_info.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/upgrade/1.3/migrate_info.py b/tools/upgrade/1.3/migrate_info.py index 5ff4b73b7..e72599daf 100755 --- a/tools/upgrade/1.3/migrate_info.py +++ b/tools/upgrade/1.3/migrate_info.py @@ -4,7 +4,8 @@ import os import sys import lxml.etree import Bcfg2.Options -from Bcfg2.Server.Plugin import info_regex +from Bcfg2.Server.Plugin import INFO_REGEX + def convert(info_file): info_xml = os.path.join(os.path.dirname(info_file), "info.xml") @@ -15,7 +16,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) if match: mgd = match.groupdict() for key, value in list(mgd.items()): @@ -25,6 +26,7 @@ def convert(info_file): open(info_xml, "w").write(lxml.etree.tostring(fileinfo, pretty_print=True)) os.unlink(info_file) + def main(): opts = dict(repo=Bcfg2.Options.SERVER_REPOSITORY, configfile=Bcfg2.Options.CFILE, |