Bläddra i källkod

remove deprecated command: borg change-passphrase

replaced by: borg key change-passphrase
Thomas Waldmann 6 år sedan
förälder
incheckning
7cd1b8151e
3 ändrade filer med 3 tillägg och 19 borttagningar
  1. 0 1
      setup_docs.py
  2. 0 15
      src/borg/archiver.py
  3. 3 3
      src/borg/testsuite/archiver.py

+ 0 - 1
setup_docs.py

@@ -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',

+ 0 - 15
src/borg/archiver.py

@@ -306,11 +306,6 @@ class Archiver:
             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 @@ class Archiver:
         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.

+ 3 - 3
src/borg/testsuite/archiver.py

@@ -1555,7 +1555,7 @@ class ArchiverTestCase(ArchiverTestCaseBase):
     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 @@ class ArchiverTestCase(ArchiverTestCaseBase):
         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 @@ id: 2 / e29442 3506da 4e1ea7 / 25f62a 5a3d41 - 02
             ['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: