aboutsummaryrefslogtreecommitdiff
path: root/rp/config/rpki-confgen
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2016-02-15 17:11:55 +0000
committerRob Austein <sra@hactrn.net>2016-02-15 17:11:55 +0000
commit33f37a6caa6ed69a9463b2684cab8b8510e4b3ae (patch)
tree6dded6b2fbbec68be3a68b653cc2fcb51f460c4b /rp/config/rpki-confgen
parentdef95e42fda9a9e45bdf4f40a6ecb93b644dbf0b (diff)
First round of silly bugfixes.
svn path=/branches/tk705/; revision=6258
Diffstat (limited to 'rp/config/rpki-confgen')
-rwxr-xr-xrp/config/rpki-confgen13
1 files changed, 6 insertions, 7 deletions
diff --git a/rp/config/rpki-confgen b/rp/config/rpki-confgen
index e6780446..7fac9eab 100755
--- a/rp/config/rpki-confgen
+++ b/rp/config/rpki-confgen
@@ -140,7 +140,7 @@ def wiki_header(f, ident, toc):
f.write("[[PageOutline]]\n")
def conf_header(f, ident):
- f.write(textproc.dedent('''\
+ f.write(textwrap.dedent('''\
# Automatically generated. Edit as needed, but be careful of overwriting.
#
# Generated from {ident}
@@ -200,7 +200,7 @@ class main(object):
self.option_map = None
root = ElementTree(file = arg).getroot()
self.ident = root.get("ident")
- self.sections.extend(Section.from_xml(x) for x in root)
+ self.sections.extend(Section.from_xml(x) for x in root.iterchildren("section"))
self.option_map = {}
self.section_map = {}
for section in self.sections:
@@ -268,11 +268,10 @@ class main(object):
section.to_wiki(f)
def do_write_conf(self, arg):
- with open(arg, "w") as f:
- conf_header(f, self.ident)
- width = max(s.width for s in self.sections)
- for section in self.sections:
- section.to_conf(f, width)
+ conf_header(arg, self.ident)
+ width = max(s.width for s in self.sections)
+ for section in self.sections:
+ section.to_conf(arg, width)
def do_toc(self, arg):
self.toc = arg