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.
This commit is contained in:
Darren Sanders 2023-08-29 13:37:25 -07:00 committed by dms00
parent cd45d08409
commit c034b0f789
1 changed files with 2 additions and 2 deletions

View File

@ -57,7 +57,7 @@ def backup_status(env):
"/usr/bin/duplicity", "/usr/bin/duplicity",
"collection-status", "collection-status",
"--archive-dir", backup_cache_dir, "--archive-dir", backup_cache_dir,
"--gpg-options", "--cipher-algo=AES256", "--gpg-options", "'--cipher-algo=AES256'",
"--log-fd", "1", "--log-fd", "1",
get_duplicity_target_url(config), get_duplicity_target_url(config),
] + get_duplicity_additional_args(env), ] + get_duplicity_additional_args(env),
@ -321,7 +321,7 @@ def perform_backup(full_backup):
"--archive-dir", backup_cache_dir, "--archive-dir", backup_cache_dir,
"--exclude", backup_root, "--exclude", backup_root,
"--volsize", "250", "--volsize", "250",
"--gpg-options", "--cipher-algo=AES256", "--gpg-options", "'--cipher-algo=AES256'",
env["STORAGE_ROOT"], env["STORAGE_ROOT"],
get_duplicity_target_url(config), get_duplicity_target_url(config),
"--allow-source-mismatch" "--allow-source-mismatch"