Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
03f0b076
Commit
03f0b076
authored
8 years ago
by
Chandrasekhar Ramakrishnan
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-4670: Offer the skip verification option globally -- needed for token saving to work.
parent
f7bc6161
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/python/OBis/obis/scripts/cli.py
+13
-15
13 additions, 15 deletions
src/python/OBis/obis/scripts/cli.py
with
13 additions
and
15 deletions
src/python/OBis/obis/scripts/cli.py
+
13
−
15
View file @
03f0b076
...
...
@@ -46,9 +46,11 @@ def check_result(command, result):
@click.group
()
@click.option
(
'
-q
'
,
'
--quiet
'
,
default
=
False
,
is_flag
=
True
,
help
=
'
Suppress status reporting.
'
)
@click.option
(
'
-s
'
,
'
--skip_verification
'
,
default
=
False
,
is_flag
=
True
,
help
=
'
Do not verify cerficiates
'
)
@click.pass_context
def
cli
(
ctx
,
quiet
):
def
cli
(
ctx
,
quiet
,
skip_verification
):
ctx
.
obj
[
'
quiet
'
]
=
quiet
ctx
.
obj
[
'
verify_certificates
'
]
=
not
skip_verification
@cli.command
()
...
...
@@ -73,12 +75,10 @@ def clone(ctx, url):
@click.pass_context
@click.option
(
'
-m
'
,
'
--msg
'
,
prompt
=
True
,
help
=
'
A message explaining what was done.
'
)
@click.option
(
'
-a
'
,
'
--auto_add
'
,
default
=
True
,
is_flag
=
True
,
help
=
'
Automatically add all untracked files.
'
)
@click.option
(
'
-s
'
,
'
--skip_verification
'
,
default
=
False
,
is_flag
=
True
,
help
=
'
Do not verify cerficiates
'
)
def
commit
(
ctx
,
msg
,
auto_add
,
skip_verification
):
def
commit
(
ctx
,
msg
,
auto_add
):
"""
Commit the repository to git and inform openBIS.
"""
verify_certificates
=
not
skip_verification
data_mgmt
=
shared_data_mgmt
(
verify_certificates
=
verify_certificates
)
data_mgmt
=
shared_data_mgmt
(
verify_certificates
=
ctx
.
obj
[
'
verify_certificates
'
])
return
check_result
(
"
commit
"
,
data_mgmt
.
commit
(
msg
,
auto_add
))
...
...
@@ -92,9 +92,9 @@ def config(ctx, is_global, property, value):
Configure the openBIS server url, the data set type, and the data set properties.
"""
d
m
=
shared_data_mgmt
()
resolver
=
d
m
.
config_resolver
top_level_path
=
d
m
.
git_wrapper
.
git_top_level_path
()
d
ata_mgmt
=
shared_data_mgmt
(
verify_certificates
=
ctx
.
obj
[
'
verify_certificates
'
]
)
resolver
=
d
ata_mgmt
.
config_resolver
top_level_path
=
d
ata_mgmt
.
git_wrapper
.
git_top_level_path
()
if
top_level_path
.
success
():
resolver
.
location_resolver
.
location_roots
[
'
data_set
'
]
=
top_level_path
.
output
if
is_global
:
...
...
@@ -111,7 +111,7 @@ def config(ctx, is_global, property, value):
loc
=
'
global
'
if
is_global
else
'
local
'
resolver
.
set_value_for_parameter
(
property
,
value
,
loc
)
if
not
is_global
:
d
m
.
commit_metadata_updates
(
property
)
d
ata_mgmt
.
commit_metadata_updates
(
property
)
@cli.group
()
...
...
@@ -128,7 +128,7 @@ def init(ctx):
def
data
(
ctx
,
folder
,
name
):
"""
Initialize the folder as a data folder.
"""
click_echo
(
"
init data {}
"
.
format
(
folder
))
data_mgmt
=
shared_data_mgmt
()
data_mgmt
=
shared_data_mgmt
(
verify_certificates
=
ctx
.
obj
[
'
verify_certificates
'
]
)
name
=
name
if
name
!=
""
else
None
return
check_result
(
"
init data
"
,
data_mgmt
.
init_data
(
folder
,
name
))
...
...
@@ -155,19 +155,17 @@ def get(ctx, f):
def
status
(
ctx
):
"""
Sync the repository with openBIS.
"""
data_mgmt
=
shared_data_mgmt
()
data_mgmt
=
shared_data_mgmt
(
verify_certificates
=
ctx
.
obj
[
'
verify_certificates
'
]
)
result
=
data_mgmt
.
status
()
click
.
echo
(
result
.
output
)
@cli.command
()
@click.pass_context
@click.option
(
'
-s
'
,
'
--skip_verification
'
,
default
=
False
,
is_flag
=
True
,
help
=
'
Do not verify cerficiates
'
)
def
sync
(
ctx
,
skip_verification
):
def
sync
(
ctx
):
"""
Sync the repository with openBIS.
"""
verify_certificates
=
not
skip_verification
data_mgmt
=
shared_data_mgmt
(
verify_certificates
=
verify_certificates
)
data_mgmt
=
shared_data_mgmt
(
verify_certificates
=
ctx
.
obj
[
'
verify_certificates
'
])
return
check_result
(
"
sync
"
,
data_mgmt
.
sync
())
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment