From 5331b378f74695cf8397ac085800fbf3bd73a857 Mon Sep 17 00:00:00 2001 From: Milkey Mouse Date: Sat, 25 Nov 2017 12:48:00 -0800 Subject: [PATCH] fixup! Add borg config command (fixes #3304) Don't use list unpacking for function calls in order to support py3.4 Reword basic borg config help It doesn't edit the repo config, but any borg-related config. --- src/borg/archiver.py | 2 +- src/borg/testsuite/archiver.py | 22 ++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/borg/archiver.py b/src/borg/archiver.py index 7feb41083..13fc3db2a 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -3733,7 +3733,7 @@ def define_archive_filters_group(subparser, *, sort_by=True, first_last=True): description=self.do_config.__doc__, epilog=config_epilog, formatter_class=argparse.RawDescriptionHelpFormatter, - help='get and set repository config options') + help='get and set configuration values') subparser.set_defaults(func=self.do_config) subparser.add_argument('-c', '--cache', dest='cache', action='store_true', help='get and set values from the repo cache') diff --git a/src/borg/testsuite/archiver.py b/src/borg/testsuite/archiver.py index a773bd924..0d36a27f1 100644 --- a/src/borg/testsuite/archiver.py +++ b/src/borg/testsuite/archiver.py @@ -2782,14 +2782,20 @@ def test_config(self): self.create_test_files() os.unlink('input/flagfile') self.cmd('init', '--encryption=repokey', self.repository_location) - for flags in [[], ['--cache']]: - for cfg_key in {'testkey', 'testsection.testkey'}: - self.cmd('config', self.repository_location, *flags, cfg_key, exit_code=1) - self.cmd('config', self.repository_location, *flags, cfg_key, 'testcontents') - output = self.cmd('config', self.repository_location, *flags, cfg_key) - assert output == 'testcontents\n' - self.cmd('config', self.repository_location, *flags, '--delete', cfg_key) - self.cmd('config', self.repository_location, *flags, cfg_key, exit_code=1) + for cfg_key in {'testkey', 'testsection.testkey'}: + self.cmd('config', self.repository_location, cfg_key, exit_code=1) + self.cmd('config', self.repository_location, cfg_key, 'testcontents') + output = self.cmd('config', self.repository_location, cfg_key) + assert output == 'testcontents\n' + self.cmd('config', self.repository_location, '--delete', cfg_key) + self.cmd('config', self.repository_location, cfg_key, exit_code=1) + + self.cmd('config', self.repository_location, '--cache', cfg_key, exit_code=1) + self.cmd('config', self.repository_location, '--cache', cfg_key, 'testcontents') + output = self.cmd('config', self.repository_location, '--cache', cfg_key) + assert output == 'testcontents\n' + self.cmd('config', self.repository_location, '--cache', '--delete', cfg_key) + self.cmd('config', self.repository_location, '--cache', cfg_key, exit_code=1) requires_gnutar = pytest.mark.skipif(not have_gnutar(), reason='GNU tar must be installed for this test.') requires_gzip = pytest.mark.skipif(not shutil.which('gzip'), reason='gzip must be installed for this test.')