chiark / gitweb /
make-secnet-sites: OpUserv: Rename sitesfile to outputfile
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 4 Dec 2019 16:50:48 +0000 (16:50 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Feb 2020 21:56:53 +0000 (21:56 +0000)
This is not entirely right for OpUserv because OpUserv reads it too.
But this is going to make sense when we reuse more of OpBase.

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

index d9ed821..e18c6ce 100755 (executable)
@@ -299,19 +299,19 @@ class OpBase():
                else:
                        self.inputlines = pfilepath(self.inputfile)
        def write_out(self):
-               if self.sitesfile is None:
+               if self.outputfile is None:
                        f=sys.stdout
                else:
-                       f=open(self.sitesfile+"-tmp",'w')
+                       f=open(self.outputfile+"-tmp",'w')
                f.write("# sites file autogenerated by make-secnet-sites\n")
                self.write_out_heading(f)
                f.write("# use make-secnet-sites to turn this file into a\n")
                f.write("# valid /etc/secnet/sites.conf file\n\n")
                self.write_out_contents(f)
                f.write("# end of sites file\n")
-               if self.sitesfile is not None:
+               if self.outputfile is not None:
                        f.close()
-                       os.rename(self.sitesfile+"-tmp",self.sitesfile)
+                       os.rename(self.outputfile+"-tmp",self.outputfile)
 
 class OpConf(OpBase):
        opts = ['--conf']
@@ -340,7 +340,7 @@ class OpUserv(OpBase):
                        print("Wrong number of arguments")
                        sys.exit(1)
                (self.header, self.groupfiledir,
-                self.sitesfile, self.group) = av.arg
+                self.outputfile, self.group) = av.arg
                self.group = Tainted(self.group,0,'command line')
                # untrusted argument from caller
                if "USERV_USER" not in os.environ: