Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caucase
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Łukasz Nowak
caucase
Commits
7f9e56cf
Commit
7f9e56cf
authored
Jul 21, 2018
by
Vincent Pelletier
Committed by
Vincent Pelletier
Sep 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
all: Reduce differences with python3.
Using only 2to3 conversions which are python2-compatible.
parent
719959e0
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
58 deletions
+73
-58
caucase/ca.py
caucase/ca.py
+1
-1
caucase/cli.py
caucase/cli.py
+66
-51
caucase/test.py
caucase/test.py
+3
-3
caucase/utils.py
caucase/utils.py
+1
-1
caucase/wsgi.py
caucase/wsgi.py
+2
-2
No files found.
caucase/ca.py
View file @
7f9e56cf
...
...
@@ -625,7 +625,7 @@ class CertificateAuthority(object):
self
.
_renewCAIfNeeded
()
result
=
[]
iter_key_pair
=
iter
(
self
.
_ca_key_pairs_list
)
first_key_pair
=
iter_key_pair
.
next
(
)
first_key_pair
=
next
(
iter_key_pair
)
previous_crt_pem
=
utils
.
dump_certificate
(
first_key_pair
[
'crt'
])
previous_key
=
first_key_pair
[
'key'
]
for
key_pair
in
iter_key_pair
:
...
...
caucase/cli.py
View file @
7f9e56cf
This diff is collapsed.
Click to expand it.
caucase/test.py
View file @
7f9e56cf
...
...
@@ -107,7 +107,7 @@ def canConnect(address): # pragma: no cover
"""
try
:
socket
.
create_connection
(
address
)
except
socket
.
error
,
e
:
except
socket
.
error
as
e
:
if
e
.
errno
==
errno
.
ECONNREFUSED
:
return
False
raise
...
...
@@ -334,7 +334,7 @@ class CaucaseTest(unittest.TestCase):
new_key_path
,
),
)
except
SystemExit
,
e
:
except
SystemExit
as
e
:
return
e
.
code
# pragma: no cover
except
:
# pylint: disable=bare-except
return
1
...
...
@@ -896,7 +896,7 @@ class CaucaseTest(unittest.TestCase):
client
=
CaucaseClient
(
self
.
_caucase_url
+
'/cas'
)
try
:
client
.
createCertificateSigningRequest
(
'Not actually a CSR'
)
except
CaucaseError
,
e
:
except
CaucaseError
as
e
:
self
.
assertEqual
(
e
.
args
[
0
],
400
,
e
)
else
:
# pragma: no cover
raise
AssertionError
(
'Did not raise CaucaseError(400, ...)'
)
...
...
caucase/utils.py
View file @
7f9e56cf
...
...
@@ -264,7 +264,7 @@ def _verifyCertificateChain(cert, trusted_cert_list, crl):
except
(
crypto
.
X509StoreContextError
,
crypto
.
Error
,
)
,
e
:
)
as
e
:
raise
CertificateVerificationError
(
'Certificate verification error: %s'
%
str
(
e
),
)
...
...
caucase/wsgi.py
View file @
7f9e56cf
...
...
@@ -572,13 +572,13 @@ class Application(object):
raise
InsufficientStorage
except
exceptions
.
NotJSON
:
raise
BadRequest
(
'Invalid json payload'
)
except
exceptions
.
CertificateAuthorityException
,
e
:
except
exceptions
.
CertificateAuthorityException
as
e
:
raise
BadRequest
(
str
(
e
))
except
Exception
:
environ
[
'wsgi.errors'
].
write
(
'Unhandled exception
\
n
'
)
traceback
.
print_exc
(
file
=
environ
[
'wsgi.errors'
])
raise
ApplicationError
except
ApplicationError
,
e
:
except
ApplicationError
as
e
:
status
=
e
.
status
header_list
=
e
.
response_headers
result
=
[
str
(
x
)
for
x
in
e
.
args
]
...
...
Write
Preview
Markdown
is supported
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