From a98b343c7767a21ed816114083f17c455ba859c6 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 10 Mar 2020 18:00:57 +0000 Subject: [PATCH] make-secnet-sites: Tolerate unused group in additions to location 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 --- make-secnet-sites | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/make-secnet-sites b/make-secnet-sites index 13a6c04..0520486 100755 --- a/make-secnet-sites +++ b/make-secnet-sites @@ -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 -- 2.30.2