Fix broken repository detection in the "rcreate" action with Borg 1.4 (#820).
This commit is contained in:
parent
009062128d
commit
ad1d104d65
3 changed files with 5 additions and 3 deletions
2
NEWS
2
NEWS
|
@ -1,5 +1,7 @@
|
||||||
1.8.8.dev0
|
1.8.8.dev0
|
||||||
* #818: Allow the "--repository" flag to match across multiple configuration files.
|
* #818: Allow the "--repository" flag to match across multiple configuration files.
|
||||||
|
* #820: Fix broken repository detection in the "rcreate" action with Borg 1.4. The issue did not
|
||||||
|
occur with other versions of Borg.
|
||||||
|
|
||||||
1.8.7
|
1.8.7
|
||||||
* #736: Store included configuration files within each backup archive in support of the "config
|
* #736: Store included configuration files within each backup archive in support of the "config
|
||||||
|
|
|
@ -8,7 +8,7 @@ from borgmatic.execute import DO_NOT_CAPTURE, execute_command
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
RINFO_REPOSITORY_NOT_FOUND_EXIT_CODE = 2
|
RINFO_REPOSITORY_NOT_FOUND_EXIT_CODES = {2, 13}
|
||||||
|
|
||||||
|
|
||||||
def create_repository(
|
def create_repository(
|
||||||
|
@ -45,7 +45,7 @@ def create_repository(
|
||||||
logger.info(f'{repository_path}: Repository already exists. Skipping creation.')
|
logger.info(f'{repository_path}: Repository already exists. Skipping creation.')
|
||||||
return
|
return
|
||||||
except subprocess.CalledProcessError as error:
|
except subprocess.CalledProcessError as error:
|
||||||
if error.returncode != RINFO_REPOSITORY_NOT_FOUND_EXIT_CODE:
|
if error.returncode not in RINFO_REPOSITORY_NOT_FOUND_EXIT_CODES:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
lock_wait = config.get('lock_wait')
|
lock_wait = config.get('lock_wait')
|
||||||
|
|
|
@ -18,7 +18,7 @@ def insert_rinfo_command_found_mock():
|
||||||
|
|
||||||
def insert_rinfo_command_not_found_mock():
|
def insert_rinfo_command_not_found_mock():
|
||||||
flexmock(module.rinfo).should_receive('display_repository_info').and_raise(
|
flexmock(module.rinfo).should_receive('display_repository_info').and_raise(
|
||||||
subprocess.CalledProcessError(module.RINFO_REPOSITORY_NOT_FOUND_EXIT_CODE, [])
|
subprocess.CalledProcessError(sorted(module.RINFO_REPOSITORY_NOT_FOUND_EXIT_CODES)[0], [])
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue