mirror of
https://github.com/borgbackup/borg.git
synced 2026-04-01 15:15:59 -04:00
Merge pull request #4458 from ThomasWaldmann/fix-4348-1.1
Fix 4348 (1.1-maint backport)
This commit is contained in:
commit
1cd8ca297a
2 changed files with 16 additions and 4 deletions
|
|
@ -352,10 +352,14 @@ class Archiver:
|
|||
if not args.path:
|
||||
self.print_error("output file to export key to expected")
|
||||
return EXIT_ERROR
|
||||
if args.qr:
|
||||
manager.export_qr(args.path)
|
||||
else:
|
||||
manager.export(args.path)
|
||||
try:
|
||||
if args.qr:
|
||||
manager.export_qr(args.path)
|
||||
else:
|
||||
manager.export(args.path)
|
||||
except IsADirectoryError:
|
||||
self.print_error("'{}' must be a file, not a directory".format(args.path))
|
||||
return EXIT_ERROR
|
||||
return EXIT_SUCCESS
|
||||
|
||||
@with_repository(lock=False, exclusive=False, manifest=False, cache=False)
|
||||
|
|
|
|||
|
|
@ -2650,6 +2650,14 @@ class ArchiverTestCase(ArchiverTestCaseBase):
|
|||
assert export_contents.startswith('<!doctype html>')
|
||||
assert export_contents.endswith('</html>')
|
||||
|
||||
def test_key_export_directory(self):
|
||||
export_directory = self.output_path + '/exported'
|
||||
os.mkdir(export_directory)
|
||||
|
||||
self.cmd('init', self.repository_location, '--encryption', 'repokey')
|
||||
|
||||
self.cmd('key', 'export', self.repository_location, export_directory, exit_code=EXIT_ERROR)
|
||||
|
||||
def test_key_import_errors(self):
|
||||
export_file = self.output_path + '/exported'
|
||||
self.cmd('init', self.repository_location, '--encryption', 'keyfile')
|
||||
|
|
|
|||
Loading…
Reference in a new issue