From c034b0f7899c62e085894ba4ac961519181f0161 Mon Sep 17 00:00:00 2001 From: Darren Sanders Date: Tue, 29 Aug 2023 13:37:25 -0700 Subject: [PATCH] Fix how the value is being passed for the gpg-options parameter Duplicity v2.1.0 backups are failing with the error: "... --gpg-options expected one argument". The issue is that duplicity v2.1.0 began using the argparse Python library and the parse_known_args function. This function interprets the argument being passed, "--cipher-algo=AES256", as an argument name (because of the leading '-') and not as an argument value. Because of that it exits with an error and reports that the --gpg-options arg is missing its value. Adding an extra set of quotes around this string causes parse_known_args to interpret the string as an argument value. --- management/backup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/management/backup.py b/management/backup.py index 06285ba5..b7102e5b 100755 --- a/management/backup.py +++ b/management/backup.py @@ -57,7 +57,7 @@ def backup_status(env): "/usr/bin/duplicity", "collection-status", "--archive-dir", backup_cache_dir, - "--gpg-options", "--cipher-algo=AES256", + "--gpg-options", "'--cipher-algo=AES256'", "--log-fd", "1", get_duplicity_target_url(config), ] + get_duplicity_additional_args(env), @@ -321,7 +321,7 @@ def perform_backup(full_backup): "--archive-dir", backup_cache_dir, "--exclude", backup_root, "--volsize", "250", - "--gpg-options", "--cipher-algo=AES256", + "--gpg-options", "'--cipher-algo=AES256'", env["STORAGE_ROOT"], get_duplicity_target_url(config), "--allow-source-mismatch"