mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-23 08:16:54 +00:00
remove deprecated command: borg change-passphrase
replaced by: borg key change-passphrase
This commit is contained in:
parent
c089d6e8ab
commit
7cd1b8151e
3 changed files with 3 additions and 19 deletions
|
@ -288,7 +288,6 @@ class build_man(Command):
|
|||
'break-lock': 'lock',
|
||||
'with-lock': 'lock',
|
||||
|
||||
'change-passphrase': 'key',
|
||||
'key_change-passphrase': 'key',
|
||||
'key_export': 'key',
|
||||
'key_import': 'key',
|
||||
|
|
|
@ -306,11 +306,6 @@ def do_change_passphrase(self, args, repository, manifest, key):
|
|||
logger.info('Key location: %s', key.find_key())
|
||||
return EXIT_SUCCESS
|
||||
|
||||
def do_change_passphrase_deprecated(self, args):
|
||||
logger.warning('"borg change-passphrase" is deprecated and will be removed in Borg 1.2.\n'
|
||||
'Use "borg key change-passphrase" instead.')
|
||||
return self.do_change_passphrase(args)
|
||||
|
||||
@with_repository(lock=False, exclusive=False, manifest=False, cache=False)
|
||||
def do_key_export(self, args, repository):
|
||||
"""Export the repository key for backup"""
|
||||
|
@ -2925,16 +2920,6 @@ def define_archive_filters_group(subparser, *, sort_by=True, first_last=True):
|
|||
subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='',
|
||||
type=location_validator(archive=False))
|
||||
|
||||
# Borg 1.0 alias for change passphrase (without the "key" subcommand)
|
||||
subparser = subparsers.add_parser('change-passphrase', parents=[common_parser], add_help=False,
|
||||
description=self.do_change_passphrase.__doc__,
|
||||
epilog=change_passphrase_epilog,
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||
help='change repository passphrase')
|
||||
subparser.set_defaults(func=self.do_change_passphrase_deprecated)
|
||||
subparser.add_argument('location', metavar='REPOSITORY', nargs='?', default='',
|
||||
type=location_validator(archive=False))
|
||||
|
||||
migrate_to_repokey_epilog = process_epilog("""
|
||||
This command migrates a repository from passphrase mode (removed in Borg 1.0)
|
||||
to repokey mode.
|
||||
|
|
|
@ -1555,7 +1555,7 @@ def test_unknown_feature_on_cache_sync(self):
|
|||
def test_unknown_feature_on_change_passphrase(self):
|
||||
print(self.cmd('init', '--encryption=repokey', self.repository_location))
|
||||
self.add_unknown_feature(Manifest.Operation.CHECK)
|
||||
self.cmd_raises_unknown_feature(['change-passphrase', self.repository_location])
|
||||
self.cmd_raises_unknown_feature(['key', 'change-passphrase', self.repository_location])
|
||||
|
||||
def test_unknown_feature_on_read(self):
|
||||
print(self.cmd('init', '--encryption=repokey', self.repository_location))
|
||||
|
@ -2082,7 +2082,7 @@ def test_change_passphrase(self):
|
|||
self.cmd('init', '--encryption=repokey', self.repository_location)
|
||||
os.environ['BORG_NEW_PASSPHRASE'] = 'newpassphrase'
|
||||
# here we have both BORG_PASSPHRASE and BORG_NEW_PASSPHRASE set:
|
||||
self.cmd('change-passphrase', self.repository_location)
|
||||
self.cmd('key', 'change-passphrase', self.repository_location)
|
||||
os.environ['BORG_PASSPHRASE'] = 'newpassphrase'
|
||||
self.cmd('list', self.repository_location)
|
||||
|
||||
|
@ -2885,7 +2885,7 @@ def test_detect_attic_repo(self):
|
|||
['info', path + '::test'],
|
||||
['key', 'export', path, 'exported'],
|
||||
['key', 'import', path, 'import'],
|
||||
['change-passphrase', path],
|
||||
['key', 'change-passphrase', path],
|
||||
['break-lock', path],
|
||||
]
|
||||
for args in cmds:
|
||||
|
|
Loading…
Reference in a new issue