Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
kedifa
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
kedifa
Commits
c89c31a5
Commit
c89c31a5
authored
May 29, 2019
by
Łukasz Nowak
Committed by
Łukasz Nowak
May 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cli: Allow to run --preapre-only w/o additional information
/reviewed-on
nexedi/kedifa!4
parent
acf0f054
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
kedifa/cli.py
kedifa/cli.py
+7
-6
kedifa/test.py
kedifa/test.py
+11
-1
No files found.
kedifa/cli.py
View file @
c89c31a5
...
@@ -146,21 +146,20 @@ def updater(*args):
...
@@ -146,21 +146,20 @@ def updater(*args):
'state'
,
'state'
,
type
=
str
,
type
=
str
,
help
=
'Path to JSON state file for fallback recognition, on which locks '
help
=
'Path to JSON state file for fallback recognition, on which locks '
'will happen.'
'will happen.'
,
nargs
=
'?'
)
)
parser
.
add_argument
(
parser
.
add_argument
(
'--identity'
,
'--identity'
,
type
=
argparse
.
FileType
(
'r'
),
type
=
argparse
.
FileType
(
'r'
),
help
=
'Certificate to identify itself on the URL.'
,
help
=
'Certificate to identify itself on the URL.'
,
required
=
True
)
)
parser
.
add_argument
(
parser
.
add_argument
(
'--server-ca-certificate'
,
'--server-ca-certificate'
,
type
=
argparse
.
FileType
(
'r'
),
type
=
argparse
.
FileType
(
'r'
),
help
=
'CA Certificate of the server.'
,
help
=
'CA Certificate of the server.'
,
required
=
True
)
)
parser
.
add_argument
(
parser
.
add_argument
(
...
@@ -200,10 +199,12 @@ def updater(*args):
...
@@ -200,10 +199,12 @@ def updater(*args):
u
=
Updater
(
u
=
Updater
(
parsed
.
sleep
,
parsed
.
mapping
.
name
,
parsed
.
state
,
parsed
.
master_certificate
,
parsed
.
sleep
,
parsed
.
mapping
.
name
,
parsed
.
state
,
parsed
.
master_certificate
,
parsed
.
on_update
,
parsed
.
identity
.
name
,
parsed
.
server_ca_certificate
.
name
,
parsed
.
on_update
,
parsed
.
identity
and
parsed
.
identity
.
name
or
None
,
parsed
.
server_ca_certificate
and
parsed
.
server_ca_certificate
.
name
or
None
,
parsed
.
once
,
parsed
.
prepare_only
parsed
.
once
,
parsed
.
prepare_only
)
)
parsed
.
mapping
.
close
()
parsed
.
mapping
.
close
()
parsed
.
identity
.
close
()
parsed
.
identity
and
parsed
.
identity
.
close
()
parsed
.
server_ca_certificate
.
close
()
parsed
.
server_ca_certificate
and
parsed
.
server_ca_certificate
.
close
()
u
.
loop
()
u
.
loop
()
kedifa/test.py
View file @
c89c31a5
...
@@ -1339,6 +1339,16 @@ class KedifaUpdaterUpdateCertificateTest(
...
@@ -1339,6 +1339,16 @@ class KedifaUpdaterUpdateCertificateTest(
self
.
assertTrue
(
update
)
self
.
assertTrue
(
update
)
self
.
assertState
({
self
.
certificate_file_name
:
True
})
self
.
assertState
({
self
.
certificate_file_name
:
True
})
class
KedifaUpdaterUpdateCertificatePrepareTest
(
KedifaUpdaterMixin
,
unittest
.
TestCase
):
def
setUp
(
self
):
super
(
KedifaUpdaterUpdateCertificatePrepareTest
,
self
).
setUp
()
certificate_file
=
tempfile
.
NamedTemporaryFile
(
dir
=
self
.
testdir
,
delete
=
True
)
certificate_file
.
close
()
self
.
certificate_file_name
=
certificate_file
.
name
def
_prepare
(
self
,
certificate
,
master_content
,
fallback
=
None
):
def
_prepare
(
self
,
certificate
,
master_content
,
fallback
=
None
):
if
certificate
:
if
certificate
:
with
open
(
self
.
certificate_file_name
,
'w'
)
as
fh
:
with
open
(
self
.
certificate_file_name
,
'w'
)
as
fh
:
...
@@ -1362,7 +1372,7 @@ class KedifaUpdaterUpdateCertificateTest(
...
@@ -1362,7 +1372,7 @@ class KedifaUpdaterUpdateCertificateTest(
mapping
=
'%s %s'
%
(
mapping
,
fallback_file
.
name
)
mapping
=
'%s %s'
%
(
mapping
,
fallback_file
.
name
)
self
.
setupMapping
(
mapping
)
self
.
setupMapping
(
mapping
)
u
=
updater
.
Updater
(
u
=
updater
.
Updater
(
1
,
self
.
mapping
,
self
.
stat
e
,
master_file
,
None
,
None
,
1
,
self
.
mapping
,
Non
e
,
master_file
,
None
,
None
,
None
,
True
,
True
)
None
,
True
,
True
)
with
mock
.
patch
.
object
(
with
mock
.
patch
.
object
(
updater
.
Updater
,
'fetchCertificate'
)
as
fetchCertificate
:
updater
.
Updater
,
'fetchCertificate'
)
as
fetchCertificate
:
...
...
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