summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-05-22 11:30:20 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-05-22 11:30:20 -0400
commitb0877561d20cdb7a21c5761428d9643e89f53773 (patch)
tree86551b4655c4af8b58d2ab29a61f54f039b616ba /tools
parent080536f7ae475c755a1c021b83ec445d09e18aff (diff)
downloadbcfg2-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-xtools/upgrade/1.3/migrate_info.py6
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()):