Verified Commit 6aa10c91 authored by Vojtech Myslivec's avatar Vojtech Myslivec
Browse files

sentinel_ca: Use standard name for main function

parent e992a754
......@@ -7,7 +7,7 @@ import sentinel_ca
def main():
sentinel_ca.run()
sentinel_ca.main()
if __name__ == "__main__":
......
......@@ -4,6 +4,6 @@ Sentinel:CA python package
from sentinel_ca.ca import CA
from sentinel_ca.exceptions import *
from sentinel_ca.main import run
from sentinel_ca.__main__ import main
from sentinel_ca.sn import get_argparser, config
from sentinel_ca.crypto import get_cert_bytes, get_cert_common_name
......@@ -63,7 +63,7 @@ def process(r, socket, ca):
set_auth_error(r, request["sn"], request["sid"], str(e))
def run():
def main():
logger.info("Sentinel:CA starts")
ctx, socket = init_sn()
conf = config(ctx.args.config)
......@@ -75,3 +75,7 @@ def run():
while True:
process(r, socket, ca)
if __name__ == "__main__":
main()
......@@ -6,7 +6,7 @@ import json
import pytest
from sentinel_ca.main import process
from sentinel_ca.__main__ import process
from sentinel_ca.exceptions import CAError
from ...helpers import dict_to_bytes, bytes_to_dict
......
......@@ -2,7 +2,7 @@
Test whole CA processing a repeated requests
"""
from sentinel_ca.main import process
from sentinel_ca.__main__ import process
from ...helpers import dict_to_bytes, bytes_to_dict
from ...crypto_helpers import cert_from_bytes, csr_from_str, get_cert_common_name
......
......@@ -3,7 +3,7 @@ Test CA processing a good request
"""
import sn
from sentinel_ca.main import process
from sentinel_ca.__main__ import process
from ..helpers import dict_to_bytes, bytes_to_dict
from ..crypto_helpers import cert_from_bytes, csr_from_str, get_cert_common_name
......
Supports Markdown
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