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
92959d24
Commit
92959d24
authored
5 years ago
by
felmer
Browse files
Options
Downloads
Patches
Plain Diff
make obis more robust on any kind of exceptions not only ValueError
parent
3321e89b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
obis/src/python/obis/dm/commands/openbis_command.py
+1
-1
1 addition, 1 deletion
obis/src/python/obis/dm/commands/openbis_command.py
obis/src/python/obis/dm/commands/openbis_sync.py
+3
-3
3 additions, 3 deletions
obis/src/python/obis/dm/commands/openbis_sync.py
with
4 additions
and
4 deletions
obis/src/python/obis/dm/commands/openbis_command.py
+
1
−
1
View file @
92959d24
...
...
@@ -178,7 +178,7 @@ class OpenbisCommand(object):
try
:
external_dms
=
self
.
openbis
.
create_external_data_management_system
(
external_dms_id
,
external_dms_id
,
"
{}:/{}
"
.
format
(
hostname
,
edms_path
))
except
ValueError
as
error
:
except
Exception
as
error
:
return
CommandResult
(
returncode
=-
1
,
output
=
str
(
error
))
return
CommandResult
(
returncode
=
0
,
output
=
external_dms
)
...
...
This diff is collapsed.
Click to expand it.
obis/src/python/obis/dm/commands/openbis_sync.py
+
3
−
3
View file @
92959d24
...
...
@@ -47,7 +47,7 @@ class OpenbisSync(OpenbisCommand):
try
:
data_set_code
=
self
.
openbis
.
create_permId
()
return
CommandResult
(
returncode
=
0
,
output
=
""
),
data_set_code
except
ValueError
as
e
:
except
Exception
as
e
:
return
CommandResult
(
returncode
=-
1
,
output
=
str
(
e
)),
None
def
create_data_set
(
self
,
data_set_code
,
external_dms
,
repository_id
,
ignore_parent
=
False
):
...
...
@@ -69,7 +69,7 @@ class OpenbisSync(OpenbisCommand):
sample
=
sample_id
,
experiment
=
experiment_id
,
properties
=
properties
,
parents
=
parent_data_set_id
,
data_set_code
=
data_set_code
,
contents
=
contents
)
return
CommandResult
(
returncode
=
0
,
output
=
"
Created data set {}.
"
.
format
(
str
(
data_set
))),
data_set
except
ValueError
as
e
:
except
Exception
as
e
:
return
CommandResult
(
returncode
=-
1
,
output
=
str
(
e
)),
None
...
...
@@ -157,7 +157,7 @@ class OpenbisSync(OpenbisCommand):
data_set
=
self
.
openbis
.
get_dataset
(
self
.
data_set_id
())
if
self
.
git_hash_matches
(
data_set
):
return
CommandResult
(
returncode
=
0
,
output
=
"
Nothing to sync.
"
)
except
ValueError
as
e
:
except
Exception
as
e
:
if
'
no such dataset
'
in
str
(
e
):
if
info_only
:
return
CommandResult
(
returncode
=-
1
,
output
=
"
Parent data set not found in openBIS.
"
)
...
...
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