substitution problems with included files #745
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#745
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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 want constants defined in the backup-specific configuration file to substitute in the common configuration file. for example
in the common configuration file:
archive_name_format: '{backup_prefix}-{now:%Y-%m-%d_%H:%M}'
in the backup-specific config file
I would expect:
archive_name_format: 'home-{now:%Y-%m-%d_%H:%M}'
but get
archive_name_format: '{backup_prefix}-{now:%Y-%m-%d_%H:%M}'
Steps to reproduce
No response
Actual behavior
No response
Expected behavior
No response
Other notes / implementation ideas
No response
borgmatic version
No response
borgmatic installation method
No response
Borg version
1.8.1
Python version
Python 3.10.12
Database version (if applicable)
No response
Operating system and version
PRETTY_NAME="Ubuntu 22.04.3 LTS" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04.3 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy
Thanks for filing this. Unfortunately this is a documented limitation of constants currently:
I do think your use case is a valuable one though, and it's probably worth revising the feature to work across includes.
I have something that works with the following setup:
config.yaml
common/constants.yaml
common/common.yaml
Is it a happy accident that it works or should I be extra careful when upgrading to a future version? (currently using 1.8.2)
If I'm understanding correctly,
common.yaml
doesn't use any of your constants whileconfig.yaml
does. So it makes sense that this works currently. The only tricky part is that you're including the constants themselves, which is currently supported. As long as you don't introduce any use of constants withincommon.yaml
or similar includes, then you should be fine!This has been implemented as part of borgmatic 1.8.5, just released. Thanks again for the suggestion!