summaryrefslogtreecommitdiffstats
path: root/tools/upgrade
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-03-15 11:02:12 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-03-15 11:02:12 -0400
commit5784318c1905c24ae161cb1dad044de41f2e9b43 (patch)
tree1b650a4d897750e31d6e6fe671015cb572dde0a6 /tools/upgrade
parentd9fc57a3276a64129f0743dd73afad6ba63fdcc0 (diff)
downloadbcfg2-5784318c1905c24ae161cb1dad044de41f2e9b43.tar.gz
bcfg2-5784318c1905c24ae161cb1dad044de41f2e9b43.tar.bz2
bcfg2-5784318c1905c24ae161cb1dad044de41f2e9b43.zip
migrate_info.py: fixed import of info/:info parsing regex
Diffstat (limited to 'tools/upgrade')
-rwxr-xr-xtools/upgrade/1.3/migrate_info.py6
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,