chiark / gitweb /
make-secnet-sites: Fix userv invocation after pfilepath
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 17 Dec 2011 21:39:39 +0000 (21:39 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 12 Jul 2012 18:53:55 +0000 (19:53 +0100)
The commit 9b8369e07aeba5ed2c69fb4a7f74d07c8cebe015
 make-secnet-sites: refactor to break out new function "pfilepath"
broke the userv service invocation, because it turned out that later
code depended on the "headerinput" variable whose assignment had been
removed and replaced by a call to pfilepath.

Make pfilepath return the lines read from the file and assign the
result to headerinput.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
make-secnet-sites

index 547f572..5911a39 100755 (executable)
@@ -391,8 +391,10 @@ def pline(i,allow_include=False):
 
 def pfilepath(pathname,allow_include=False):
        f=open(pathname)
-       pfile(pathname,f.readlines(),allow_include=allow_include)
+       lines=f.readlines()
+       pfile(pathname,lines,allow_include=allow_include)
        f.close()
+       return lines
 
 def pfile(name,lines,allow_include=False):
        "Process a file"
@@ -465,7 +467,7 @@ else:
                if not ok:
                        print "caller not in group %s"%group
                        sys.exit(1)
-               pfilepath(header,allow_include=True)
+               headerinput=pfilepath(header,allow_include=True)
                userinput=sys.stdin.readlines()
                pfile("user input",userinput)
        else: