From fb21d4e64567a8871955c20beaea4d418ec23456 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Sat, 9 Feb 2019 21:17:55 -0800 Subject: [PATCH] Remove dead code. --- borgmatic/config/convert.py | 18 ------------------ tests/unit/config/test_convert.py | 9 --------- 2 files changed, 27 deletions(-) diff --git a/borgmatic/config/convert.py b/borgmatic/config/convert.py index 4b273877..557dff67 100644 --- a/borgmatic/config/convert.py +++ b/borgmatic/config/convert.py @@ -93,21 +93,3 @@ def guard_configuration_upgraded(source_config_filename, destination_config_file if os.path.exists(source_config_filename) and not destination_config_exists: raise LegacyConfigurationNotUpgraded() - - -class LegacyExcludesFilenamePresent(FileNotFoundError): - def __init__(self): - super(LegacyExcludesFilenamePresent, self).__init__( - '''borgmatic changed its configuration file format in version 1.1.0 from INI-style -to YAML. This better supports validation, and has a more natural way to express -lists of values. The new configuration file incorporates excludes, so you no -longer need to provide an excludes filename on the command-line with an -"--excludes" argument. - -Please remove the "--excludes" argument and run borgmatic again.''' - ) - - -def guard_excludes_filename_omitted(excludes_filename): - if excludes_filename is not None: - raise LegacyExcludesFilenamePresent() diff --git a/tests/unit/config/test_convert.py b/tests/unit/config/test_convert.py index 25892d98..15796cf3 100644 --- a/tests/unit/config/test_convert.py +++ b/tests/unit/config/test_convert.py @@ -117,12 +117,3 @@ def test_guard_configuration_upgraded_does_not_raise_when_neither_config_present flexmock(os.path).should_receive('exists').with_args('other.yaml').and_return(False) module.guard_configuration_upgraded('config', ('config.yaml', 'other.yaml')) - - -def test_guard_excludes_filename_omitted_raises_when_filename_provided(): - with pytest.raises(module.LegacyExcludesFilenamePresent): - module.guard_excludes_filename_omitted(excludes_filename='/etc/borgmatic/excludes') - - -def test_guard_excludes_filename_omitted_does_not_raise_when_filename_not_provided(): - module.guard_excludes_filename_omitted(excludes_filename=None)