chiark / gitweb /
make-secnet-sites: Tolerate unused group in additions to location
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 10 Mar 2020 18:00:57 +0000 (18:00 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 10 Mar 2020 18:31:29 +0000 (18:31 +0000)
When processing a sites file other than via userv, the group (if
specified) is not of any interest.

But since tainting, we need to bless it for re-output.  (This is
necessary even in modes where we don't actually write anything out,
like .conf generation.)

The correct place to do this is in OpConf's base class.

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

index 13a6c04..0520486 100755 (executable)
@@ -293,6 +293,9 @@ class PkmElide(PkmBase):
 class OpBase():
        # Base case is reading a sites file from self.inputfilee.
        # And writing a sites file to self.sitesfile.
+       def check_group(self,group,w):
+               if len(w) >= 3:
+                       w[2].groupname()
        def positional_args(self, av):
                if len(av.arg)>3:
                        print("Too many arguments")
@@ -321,7 +324,6 @@ class OpBase():
 class OpConf(OpBase):
        opts = ['--conf']
        help = 'sites.conf generation mode (default)'
-       def check_group(self,group,w): pass
        def write_out(self):
                if self.outputfile is None:
                        of=sys.stdout