summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
3f04bde)
This will be used to have make-secnet-sites produce
backward-compatible output for older readers.
This is mostly going to be used for a filtering mode, where
make-secnet sites will copy its input to its output downgrading things
as it goes.
It is also going to have the effect of limiting the secnet.conf file
output when --pubkeys-install is not specified, so that the peer key
that appears in the generated sites.conf is the old-style
pre-negotiation RSA key, as demanded by the spec.
The users of this variable, and the whole --pubkeys-install option,
and the filtering mode, are yet to come.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
+ --output-version NUMBER
+
+ Write backward-compatible sites file output,
+ targeting a particular sites format. Values of
+ NUMBER that are understood are:
+ 1 The original format, pre signing key
+ negotiation.
+ If NUMBER is higher than make-secnet-sites supports,
+ it writes out what it can.
+
--debug | -D
Increase amount of debugging output.
--debug | -D
Increase amount of debugging output.
from sys import version_info
if version_info.major == 2: # for python2
import codecs
from sys import version_info
if version_info.major == 2: # for python2
import codecs
global prefix
global key_prefix
global debug_level
global prefix
global key_prefix
global debug_level
ap = argparse.ArgumentParser(description='process secnet sites files')
ap.add_argument('--userv', '-u', action='store_true',
ap = argparse.ArgumentParser(description='process secnet sites files')
ap.add_argument('--userv', '-u', action='store_true',
ap.add_argument('--conf-key-prefix', action=ActionNoYes,
default=True,
help='prefix conf file key names derived from sites data')
ap.add_argument('--conf-key-prefix', action=ActionNoYes,
default=True,
help='prefix conf file key names derived from sites data')
+ ap.add_argument('--output-version', nargs=1, type=int,
+ help='sites file output version',
+ default=[max_version])
ap.add_argument('--prefix', '-P', nargs=1,
help='set prefix')
ap.add_argument('--debug', '-D', action='count', default=0)
ap.add_argument('--prefix', '-P', nargs=1,
help='set prefix')
ap.add_argument('--debug', '-D', action='count', default=0)
service = 1 if av.userv else 0
prefix = '' if av.prefix is None else av.prefix[0]
key_prefix = av.conf_key_prefix
service = 1 if av.userv else 0
prefix = '' if av.prefix is None else av.prefix[0]
key_prefix = av.conf_key_prefix
+ output_version = av.output_version[0]
if service:
if len(av.arg)!=4:
print("Wrong number of arguments")
if service:
if len(av.arg)!=4:
print("Wrong number of arguments")