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
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
caucase
Commits
c5634e69
Commit
c5634e69
authored
Nov 04, 2017
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cli.updater: Make testable.
parent
1fec835c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
caucase/cli.py
caucase/cli.py
+3
-3
No files found.
caucase/cli.py
View file @
c5634e69
...
@@ -589,7 +589,7 @@ def probe(argv=None):
...
@@ -589,7 +589,7 @@ def probe(argv=None):
if
https_ca_pem
not
in
(
http_ca_pem
,
http2_ca_pem
):
if
https_ca_pem
not
in
(
http_ca_pem
,
http2_ca_pem
):
raise
ValueError
(
'http and https do not serve the same caucase database'
)
raise
ValueError
(
'http and https do not serve the same caucase database'
)
def
updater
(
argv
=
None
):
def
updater
(
argv
=
None
,
until
=
utils
.
until
):
"""
"""
Bootstrap certificate and companion files and keep them up-to-date.
Bootstrap certificate and companion files and keep them up-to-date.
"""
"""
...
@@ -719,7 +719,7 @@ def updater(argv=None):
...
@@ -719,7 +719,7 @@ def updater(argv=None):
# through.
# through.
client
.
getCertificateSigningRequest
(
csr_id
)
client
.
getCertificateSigningRequest
(
csr_id
)
# Still here ? Ok, wait a bit and try again.
# Still here ? Ok, wait a bit and try again.
u
tils
.
interruptibleSleep
(
60
)
u
ntil
(
datetime
.
datetime
.
utcnow
()
+
datetime
.
timedelta
(
0
,
60
)
)
else
:
else
:
with
open
(
args
.
crt
,
'a'
)
as
crt_file
:
with
open
(
args
.
crt
,
'a'
)
as
crt_file
:
crt_file
.
write
(
crt_pem
)
crt_file
.
write
(
crt_pem
)
...
@@ -731,7 +731,7 @@ def updater(argv=None):
...
@@ -731,7 +731,7 @@ def updater(argv=None):
print
'Next wake-up at'
,
next_deadline
.
strftime
(
print
'Next wake-up at'
,
next_deadline
.
strftime
(
'%Y-%m-%d %H:%M:%S +0000'
'%Y-%m-%d %H:%M:%S +0000'
)
)
now
=
u
tils
.
u
ntil
(
next_deadline
)
now
=
until
(
next_deadline
)
if
args
.
cas_ca
!=
args
.
ca
and
updateCAFile
(
cas_url
,
args
.
cas_ca
):
if
args
.
cas_ca
!=
args
.
ca
and
updateCAFile
(
cas_url
,
args
.
cas_ca
):
client
=
CaucaseClient
(
client
=
CaucaseClient
(
ca_url
=
ca_url
,
ca_url
=
ca_url
,
...
...
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