mirror of
https://github.com/borgbackup/borg.git
synced 2025-01-01 12:45:34 +00:00
use print_warning also in borg delete ::archive --force --force
This commit is contained in:
parent
9de07ebd46
commit
bec02a36c8
2 changed files with 5 additions and 6 deletions
|
@ -37,8 +37,7 @@ def do_delete(self, args, repository):
|
|||
try:
|
||||
current_archive = manifest.archives.pop(archive_name)
|
||||
except KeyError:
|
||||
self.exit_code = EXIT_WARNING
|
||||
logger.warning(f"Archive {archive_name} not found ({i}/{len(archive_names)}).")
|
||||
self.print_warning(f"Archive {archive_name} not found ({i}/{len(archive_names)}).")
|
||||
else:
|
||||
deleted = True
|
||||
if self.output_list:
|
||||
|
@ -50,9 +49,9 @@ def do_delete(self, args, repository):
|
|||
manifest.write()
|
||||
# note: might crash in compact() after committing the repo
|
||||
repository.commit(compact=False)
|
||||
logger.warning('Done. Run "borg check --repair" to clean up the mess.')
|
||||
self.print_warning('Done. Run "borg check --repair" to clean up the mess.')
|
||||
else:
|
||||
logger.warning("Aborted.")
|
||||
self.print_warning("Aborted.")
|
||||
return self.exit_code
|
||||
|
||||
stats = Statistics(iec=args.iec)
|
||||
|
@ -73,7 +72,7 @@ def checkpoint_func():
|
|||
try:
|
||||
archive_info = manifest.archives[archive_name]
|
||||
except KeyError:
|
||||
logger.warning(msg_not_found.format(archive_name, i, len(archive_names)))
|
||||
self.print_warning(msg_not_found.format(archive_name, i, len(archive_names)))
|
||||
else:
|
||||
if self.output_list:
|
||||
logger_list.info(msg_delete.format(format_archive(archive_info), i, len(archive_names)))
|
||||
|
|
|
@ -76,7 +76,7 @@ def test_delete_double_force(archivers, request):
|
|||
id = archive.metadata.items[0]
|
||||
repository.put(id, b"corrupted items metadata stream chunk")
|
||||
repository.commit(compact=False)
|
||||
cmd(archiver, "delete", "-a", "test", "--force", "--force")
|
||||
cmd(archiver, "delete", "-a", "test", "--force", "--force", exit_code=1)
|
||||
cmd(archiver, "check", "--repair")
|
||||
output = cmd(archiver, "rlist")
|
||||
assert "test" not in output
|
||||
|
|
Loading…
Reference in a new issue