Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Turris
Sentinel
Certificator-CA
Commits
6aa10c91
Verified
Commit
6aa10c91
authored
Dec 20, 2019
by
Vojtech Myslivec
Browse files
sentinel_ca: Use standard name for main function
parent
e992a754
Changes
6
Hide whitespace changes
Inline
Side-by-side
ca.py
View file @
6aa10c91
...
...
@@ -7,7 +7,7 @@ import sentinel_ca
def
main
():
sentinel_ca
.
ru
n
()
sentinel_ca
.
mai
n
()
if
__name__
==
"__main__"
:
...
...
sentinel_ca/__init__.py
View file @
6aa10c91
...
...
@@ -4,6 +4,6 @@ Sentinel:CA python package
from
sentinel_ca.ca
import
CA
from
sentinel_ca.exceptions
import
*
from
sentinel_ca.main
import
ru
n
from
sentinel_ca.
__
main
__
import
mai
n
from
sentinel_ca.sn
import
get_argparser
,
config
from
sentinel_ca.crypto
import
get_cert_bytes
,
get_cert_common_name
sentinel_ca/main.py
→
sentinel_ca/
__
main
__
.py
View file @
6aa10c91
...
...
@@ -63,7 +63,7 @@ def process(r, socket, ca):
set_auth_error
(
r
,
request
[
"sn"
],
request
[
"sid"
],
str
(
e
))
def
ru
n
():
def
mai
n
():
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
()
tests/process/errors/test_process.py
View file @
6aa10c91
...
...
@@ -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
...
...
tests/process/repeated/test_process.py
View file @
6aa10c91
...
...
@@ -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
...
...
tests/process/test_process.py
View file @
6aa10c91
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment