Skip to content

Commit

Permalink
cli: return 1 if failure
Browse files Browse the repository at this point in the history
  • Loading branch information
eimrek committed Nov 8, 2023
1 parent 9de905a commit a2031d9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions disk_objectstore/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,20 +236,20 @@ def backup(
backup_utils.logger.setLevel(logging.DEBUG)
else:
click.echo("Unsupported verbosity.")
return
return 1

Check warning on line 239 in disk_objectstore/cli.py

View check run for this annotation

Codecov / codecov/patch

disk_objectstore/cli.py#L238-L239

Added lines #L238 - L239 were not covered by tests

try:
backup_utils_instance = backup_utils.BackupUtilities(
dest, keep, rsync_exe, backup_utils.logger
)
except ValueError as e:
click.echo(f"Error: {e}")
return
return 1

Check warning on line 247 in disk_objectstore/cli.py

View check run for this annotation

Codecov / codecov/patch

disk_objectstore/cli.py#L245-L247

Added lines #L245 - L247 were not covered by tests

success = backup_utils_instance.validate_inputs()
if not success:
click.echo("Input validation failed.")
return
return 1

Check warning on line 252 in disk_objectstore/cli.py

View check run for this annotation

Codecov / codecov/patch

disk_objectstore/cli.py#L251-L252

Added lines #L251 - L252 were not covered by tests

with dostore.container as container:
success = backup_utils_instance.backup_auto_folders(
Expand All @@ -259,4 +259,5 @@ def backup(
)
if not success:
click.echo("Error: backup failed.")
return
return 1

Check warning on line 262 in disk_objectstore/cli.py

View check run for this annotation

Codecov / codecov/patch

disk_objectstore/cli.py#L261-L262

Added lines #L261 - L262 were not covered by tests
return 0

0 comments on commit a2031d9

Please sign in to comment.