From b0877561d20cdb7a21c5761428d9643e89f53773 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Wed, 22 May 2013 11:30:20 -0400 Subject: tools: make migrate_info.py migrate "perms" (http://trac.mcs.anl.gov/projects/bcfg2/ticket/1150) --- tools/upgrade/1.3/migrate_info.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tools/upgrade/1.3/migrate_info.py') 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\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()): -- cgit v1.2.3-1-g7c22