Convert of old INI-Configfile fails because of missing YAML Rendering #367
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#367
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
I tried to convert an old INI-Config-File to the new YAML-Format but run into an Error that the file cannot be written because of the missing YAML Rendering.
Steps to reproduce
sudo upgrade-borgmatic-config -s ../borgmatic_config_files_old/backupconfig -d backupconfig.yaml
Actual behavior
sudo upgrade-borgmatic-config -s ../borgmatic_config_files_old/backupconfig -d backupconfig.yaml Traceback (most recent call last): File "/usr/local/bin/upgrade-borgmatic-config", line 8, in <module> sys.exit(main()) File "/usr/local/lib/python3.7/dist-packages/borgmatic/commands/convert_config.py", line 104, in main args.destination_config_filename, destination_config, mode=source_config_file_mode File "/usr/local/lib/python3.7/dist-packages/borgmatic/config/generate.py", line 128, in write_configuration config_file.write(rendered_config) TypeError: write() argument must be str, not CommentedMap
Other notes / implementation ideas
instead of this in /commands/convert_config.py:
this:
Environment
borgmatic version: 1.5.10
borgmatic installation method: pip
Borg version: 1.1.11
Python version: Python 3.7.3
operating system and version: Debian 10
Thank you so much for reporting this and tracking down the source of the problem! It looks like the
write_configuration()
function signature changed somewhere along the way, butconvert_config.py
wasn't ever updated to account for that. An integration test here would've been really useful.Fixed in master! Thanks again for reporting this.
Just released in borgmatic 1.5.11!