From dd16504329489c0921427f3ae414231039b08bd7 Mon Sep 17 00:00:00 2001 From: Matthew Daley Date: Fri, 13 Dec 2019 15:42:46 +1300 Subject: [PATCH] Use --remote-path, --debug and --info when checking for repo existence These are currently not being used in the call to `borg info` performed as part of the borgmatic init command to check whether or not the repo already exists. --- borgmatic/borg/init.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/borgmatic/borg/init.py b/borgmatic/borg/init.py index 152f8c1bc..08256aefa 100644 --- a/borgmatic/borg/init.py +++ b/borgmatic/borg/init.py @@ -23,7 +23,13 @@ def initialize_repository( whether the repository should be append-only, and the storage quota to use, initialize the repository. If the repository already exists, then log and skip initialization. ''' - info_command = (local_path, 'info', repository) + info_command = ( + (local_path, 'info') + + (('--info',) if logger.getEffectiveLevel() == logging.INFO else ()) + + (('--debug',) if logger.isEnabledFor(logging.DEBUG) else ()) + + (('--remote-path', remote_path) if remote_path else ()) + + (repository,) + ) logger.debug(' '.join(info_command)) try: