-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new placeholder keys #1956
base: master
Are you sure you want to change the base?
Add new placeholder keys #1956
Conversation
fqdn = _getfqdn(hostname) | ||
borg_version = os.getenv("BORG_VERSION") | ||
if not borg_version: | ||
borg_version = subprocess.run(['borg', '--version'], stdout=subprocess.PIPE).stdout.decode('utf-8') | ||
borg_version = borg_version.split(' ')[1] | ||
borg_version_tuple = tuple(borg_version.split(".")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vorta already queries borg version information on startup. Why not use that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vorta already queries borg version information on startup. Why not use that?
I get circular import error when importing borg_compat
in utils.py:
ImportError: cannot import name 'borg_compat' from partially initialized module 'vorta.utils' (most likely due to a circular import)
. This is probably why borg version is being queried again here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, be aware of circular imports. Helper functions and modules should only be used by higher level. So maybe format_archive_name()
should be moved elsewhere, since it uses helper functions now.
fqdn = _getfqdn(hostname) | ||
borg_version = os.getenv("BORG_VERSION") | ||
if not borg_version: | ||
borg_version = subprocess.run(['borg', '--version'], stdout=subprocess.PIPE).stdout.decode('utf-8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are basically sidestepping everything we do to correctly detect the right borg
binary. So while this may work in many cases, it will break in others. So as already mentioned before, it will be better to use the existing borg_compat
module.
Added 2 comments. A third issue is documenting those new keys. Can we add them in a tooltip? Should there be a docs link? |
Description
Added some Placeholder keys to vorta
Related Issue
Fixes #1954
Screenshots:
Types of changes
Checklist:
I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.