Commit 765d4737 authored by Julien Muchembled's avatar Julien Muchembled

Revert "Use slapos.cfg file instead of other arguments" partially

See commit 08b53cb3.

A signature-certificate-file configuration
that is not used elsewhere is confusing.
parent bfb35532
Pipeline #20512 failed with stage
in 0 seconds
......@@ -37,14 +37,15 @@ def generateCertificate(certificate_file, key_file, common_name):
certificate_file])
def run(*args):
def run(args=None):
parser = argparse.ArgumentParser()
parser.add_argument('slapos_config', type=argparse.FileType('r'),
help='SlapOS configuration file.')
parser.add_argument('output', help='Path of certificate to generate')
args = parser.parse_args(args)
config = configparser.SafeConfigParser()
option = parser.parse_args(list(args) or sys.argv[1:])
config.readfp(option.slapos_config)
generateCertificate(config.get('networkcache', 'signature-certificate-file'),
config.readfp(args.slapos_config)
generateCertificate(args.output,
config.get('networkcache', 'signature-private-key-file'),
config.get('slapos', 'computer_id'))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment