chiark / gitweb /
make-secnet-sites: Rework with new `inpub' class
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 1 Dec 2019 17:38:31 +0000 (17:38 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Dec 2019 21:52:07 +0000 (21:52 +0000)
commit1a9fc19073b580c7b9d82f80174c2d089c0894fa
tree32ffe6f79d771bc711afd711940a44cba360ea7c
parentfa38be78208edf2bfeaba6ff57592fb480bb8dce
make-secnet-sites: Rework with new `inpub' class

The use of k.forsites(,None,) was rather unprincipled and required a
strange comment.  Instead, invent a `forpub' method for this use.
`forsites' can be implemented, for these classes, in terms of forpub.

Likewise testing whether the return from forsites was []; replace that
with an okforonlykey method.  (The implementation uses the same trick
but now it's inside the class.)

We transpose the if `pubkeys_install' with the `for k' loop.  The `not
pubkeys_install' arm is rather different now, accumulating in outk.

The one nontrivial consquence is that now if there are multiple
eligible keys to be written to a sites.conf, we fail, rather than just
choosing the first.

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