Commit a94d10d2 authored by Joanne Hugé's avatar Joanne Hugé

WIP: cli/node.py

parent fba6ae8c
...@@ -130,6 +130,8 @@ def getConfig(): ...@@ -130,6 +130,8 @@ def getConfig():
def main(): def main():
# Get arguments # Get arguments
config = getConfig() config = getConfig()
# ca: certifcate authority certificate, key: node private key, cert: node public certificate
# verifies cert has been signed by ca
cert = x509.Cert(config.ca, config.key, config.cert) cert = x509.Cert(config.ca, config.key, config.cert)
config.openvpn_args += cert.openvpn_args config.openvpn_args += cert.openvpn_args
...@@ -146,7 +148,9 @@ def main(): ...@@ -146,7 +148,9 @@ def main():
if config.ovpnlog: if config.ovpnlog:
plib.ovpn_log = config.log plib.ovpn_log = config.log
# If program receives SIGINT or SIGTERM, exit with status 0
  • I don't like this kind of comment. One should always assume that the reader knows the API of what is used in a piece of code:

    • here, when you know what exit.signal does, the statement is trivial to understand and you don't need a comment
    • I'm not saying that exit.signal is easy to understand, but then I'd prefer it's documented with a docstring
    Edited by Julien Muchembled
Please register or sign in to reply
exit.signal(0, signal.SIGINT, signal.SIGTERM) exit.signal(0, signal.SIGINT, signal.SIGTERM)
# If program receives SIGHUP or SIGUSR2, exit with status -1
exit.signal(-1, signal.SIGHUP, signal.SIGUSR2) exit.signal(-1, signal.SIGHUP, signal.SIGUSR2)
cache = Cache(db_path, config.registry, cert) cache = Cache(db_path, config.registry, cert)
......
  • Ok I see, I don't necessarily plan on merging this by the way, at least for now.

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