Fix repository does not exist error with "borgmatic extract" when repository is remote (#243).
This commit is contained in:
parent
30525c43bf
commit
04e5b42606
3 changed files with 20 additions and 3 deletions
1
NEWS
1
NEWS
|
@ -1,6 +1,7 @@
|
||||||
1.4.9.dev0
|
1.4.9.dev0
|
||||||
* #228: Database dump hooks for MySQL/MariaDB, so you can easily dump your databases before backups
|
* #228: Database dump hooks for MySQL/MariaDB, so you can easily dump your databases before backups
|
||||||
run.
|
run.
|
||||||
|
* #243: Fix repository does not exist error with "borgmatic extract" when repository is remote.
|
||||||
|
|
||||||
1.4.8
|
1.4.8
|
||||||
* Monitor backups with Cronhub hook integration. See the documentation for more information:
|
* Monitor backups with Cronhub hook integration. See the documentation for more information:
|
||||||
|
|
|
@ -83,7 +83,7 @@ def extract_archive(
|
||||||
+ (('--debug', '--list', '--show-rc') if logger.isEnabledFor(logging.DEBUG) else ())
|
+ (('--debug', '--list', '--show-rc') if logger.isEnabledFor(logging.DEBUG) else ())
|
||||||
+ (('--dry-run',) if dry_run else ())
|
+ (('--dry-run',) if dry_run else ())
|
||||||
+ (('--progress',) if progress else ())
|
+ (('--progress',) if progress else ())
|
||||||
+ ('::'.join((os.path.abspath(repository), archive)),)
|
+ ('::'.join((repository if ':' in repository else os.path.abspath(repository), archive)),)
|
||||||
+ (tuple(paths) if paths else ())
|
+ (tuple(paths) if paths else ())
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -95,8 +95,8 @@ def extract_archive(
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
# Error on warnings, as Borg only gives a warning if the restore paths don't exist in the
|
# Error on warnings by default, as Borg only gives a warning if the restore paths don't exist in
|
||||||
# archive!
|
# the archive!
|
||||||
execute_command(
|
execute_command(
|
||||||
full_command, working_directory=destination_path, error_on_warnings=error_on_warnings
|
full_command, working_directory=destination_path, error_on_warnings=error_on_warnings
|
||||||
)
|
)
|
||||||
|
|
|
@ -236,3 +236,19 @@ def test_extract_archive_calls_borg_with_progress_parameter():
|
||||||
storage_config={},
|
storage_config={},
|
||||||
progress=True,
|
progress=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_extract_archive_skips_abspath_for_remote_repository():
|
||||||
|
flexmock(module.os.path).should_receive('abspath').never()
|
||||||
|
flexmock(module).should_receive('execute_command').with_args(
|
||||||
|
('borg', 'extract', 'server:repo::archive'), working_directory=None, error_on_warnings=True
|
||||||
|
).once()
|
||||||
|
|
||||||
|
module.extract_archive(
|
||||||
|
dry_run=False,
|
||||||
|
repository='server:repo',
|
||||||
|
archive='archive',
|
||||||
|
paths=None,
|
||||||
|
location_config={},
|
||||||
|
storage_config={},
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in a new issue