Another edge case: Don't error on non-matching restore path globs (#228).

This commit is contained in:
Dan Helfman 2019-11-12 11:24:31 -08:00
parent ebeb5efe05
commit 30525c43bf
2 changed files with 7 additions and 2 deletions

View file

@ -62,6 +62,7 @@ def extract_archive(
remote_path=None,
destination_path=None,
progress=False,
error_on_warnings=True,
):
'''
Given a dry-run flag, a local or remote repository path, an archive name, zero or more paths to
@ -90,10 +91,12 @@ def extract_archive(
# the terminal directly.
if progress:
execute_command_without_capture(
full_command, working_directory=destination_path, error_on_warnings=True
full_command, working_directory=destination_path, error_on_warnings=error_on_warnings
)
return
# Error on warnings, as Borg only gives a warning if the restore paths don't exist in the
# archive!
execute_command(full_command, working_directory=destination_path, error_on_warnings=True)
execute_command(
full_command, working_directory=destination_path, error_on_warnings=error_on_warnings
)

View file

@ -282,6 +282,8 @@ def run_actions(
remote_path=remote_path,
destination_path='/',
progress=arguments['restore'].progress,
# We don't want glob patterns that don't match to error.
error_on_warnings=False,
)
# Map the restore names or detected dumps to the corresponding database configurations.