Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-deposit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antoine R. Dumont
swh-deposit
Commits
25786360
Unverified
Commit
25786360
authored
7 years ago
by
Antoine R. Dumont
Browse files
Options
Downloads
Patches
Plain Diff
swh.deposit.client: Fix corner cases on cli
parent
2e704b59
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
swh/deposit/client/cli.py
+9
-2
9 additions, 2 deletions
swh/deposit/client/cli.py
with
9 additions
and
2 deletions
swh/deposit/client/cli.py
+
9
−
2
View file @
25786360
...
...
@@ -81,12 +81,16 @@ def parse_cli_options(username, password, archive, metadata,
if
status
and
not
deposit_id
:
raise
InputError
(
"
Deposit id must be provided for status check
"
)
if
status
and
deposit_id
:
# status is higher priority over deposit
archive_deposit
=
False
metadata_deposit
=
False
if
archive_deposit
and
metadata_deposit
:
# too many flags use, remove redundant ones (-> multipart deposit)
archive_deposit
=
False
metadata_deposit
=
False
if
archive
and
not
os
.
path
.
exists
(
archive
):
if
archive_deposit
and
archive
and
not
os
.
path
.
exists
(
archive
):
raise
InputError
(
'
Software Archive %s must exist!
'
%
archive
)
if
archive
and
not
metadata
:
...
...
@@ -101,9 +105,12 @@ def parse_cli_options(username, password, archive, metadata,
if
metadata_deposit
and
not
metadata
:
raise
InputError
(
"
Metadata deposit filepath must be provided for a metadata deposit
"
)
# noqa
if
not
status
and
not
archive
_deposit
and
not
os
.
path
.
exists
(
metadata
):
if
not
status
and
metadata
_deposit
and
not
os
.
path
.
exists
(
metadata
):
raise
InputError
(
'
Software Archive metadata %s must exist!
'
%
metadata
)
if
not
status
and
not
archive
and
not
metadata
:
raise
InputError
(
'
You should at least mention an action to do
'
)
if
replace
and
not
deposit_id
:
raise
InputError
(
'
To update an existing deposit, you must provide its id
'
)
...
...
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