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
Improve python plugin configuration #1619
Merged
BareosBot
merged 10 commits into
bareos:bareos-23
from
arogge:dev/arogge/bareos-23/better-plugin-config
Dec 11, 2023
Merged
Improve python plugin configuration #1619
BareosBot
merged 10 commits into
bareos:bareos-23
from
arogge:dev/arogge/bareos-23/better-plugin-config
Dec 11, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sebsura
approved these changes
Dec 11, 2023
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.
Looks great!
arogge
force-pushed
the
dev/arogge/bareos-23/better-plugin-config
branch
from
December 11, 2023 21:43
138d709
to
afde43a
Compare
This patch adds bVarUsedConfig that provides the path to the configuration that the fd uses. This will contain something like `/etc/bareos/bareos-fd.d/*/*.conf`. (cherry picked from commit 399b037)
this patch extends BareosFdPluginBaseclass to provide a standard way to work with plugin configuration files. When the plugin options parser encounters one of the options defaults_file or overrides_file, it will treat the values as a path to an ini-style configuration file and will try to read it. The resulting options are added with precedence overrides_file, plugin definition, defaults_file. The code will consume the defaults_file and overrides_file options, so the plugin will not see them later. (cherry picked from commit de1dd5b)
(cherry picked from commit 91d0754)
by adding a transform (currently only "enc") to an option name, the python baseclass will now decode the value. i.e. if you configure `password#enc=E+*g/GAhM4` you will end up with the option password containing the value "password". (cherry picked from commit 82193f5)
the dictionaries in the module were previously filled with arbitrary numbers that matched what we had in the enums. With this patch we now export the enum value itself, so no mismatches can happen. The patch also converts the filetype defines into an enum. (cherry picked from commit 5082c11)
(cherry picked from commit 387d6b9)
We now encode with b85encode instead of a85encode. The major difference is the set of characters used to represent the result. While a85encode will use a colon (:) that is also used as an option separator in the plugindef, b85encode will not. As a result values encoded with b85encode will be simpler to use. (cherry picked from commit 4b2e151)
(cherry picked from commit c9ee9b6)
(cherry picked from commit 62a3b07)
BareosBot
force-pushed
the
dev/arogge/bareos-23/better-plugin-config
branch
from
December 11, 2023 22:59
edb5481
to
eed4a20
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of PR #1605 to bareos-23
Backported using
git cherry-pick -x 399b037a5~..5a8643760
with no manual intervention needed.Please check
If you have any questions or problems, please give a comment in the PR.
Helpful documentation and best practices
Checklist for the reviewer of the PR (will be processed by the Bareos team)
Make sure you check/merge the PR using
devtools/pr-tool
to have some simple automated checks run and a proper changelog record added.General
Required backport PRs have been createdSource code quality
Tests