Bareos Python Plugins: fix handling of extra pluginoptions#1177
Merged
pstorz merged 7 commits intobareos:masterfrom May 18, 2022
Merged
Bareos Python Plugins: fix handling of extra pluginoptions#1177pstorz merged 7 commits intobareos:masterfrom
pstorz merged 7 commits intobareos:masterfrom
Conversation
98a87ba to
ddec5cf
Compare
ddec5cf to
015a4b1
Compare
pstorz
requested changes
May 16, 2022
Member
There was a problem hiding this comment.
I have the following change requests:
- The problem that is fixed with this PR is not described
- Variable name enhancements
- changelog.md entry is missing
- bareos-check-sources is not happy about systemtests/python-modules/bareos_unittest/json.py, needs to be formatted
- system:python-bareos:python_fd_plugins does not pass:
361: === python-bareos/test_python_fd_plugins: starting at 12:05:14 ===
361: =
361: =
361: /home/pstorz/git/PR-REVIEW/python-bareos/bareos/bsock/lowlevel.py:57: UserWarning: Connection encryption via TLS-PSK is not available, as the module sslpsk is not installed.
361: warnings.warn(
361: test_additional_pluginoptions (test_python_fd_plugins.BareosFdPythonPluginOptions) ... FAIL
361: test_overwrite_pluginoptions (test_python_fd_plugins.BareosFdPythonPluginOptions)
361: Overwrites a plugin option ... expected failure
361: test_without_extra_pluginoptions (test_python_fd_plugins.BareosFdPythonPluginOptions) ... FAIL
361:
361: ======================================================================
361: FAIL: test_additional_pluginoptions (test_python_fd_plugins.BareosFdPythonPluginOptions)
361: ----------------------------------------------------------------------
361: Traceback (most recent call last):
361: File "/home/pstorz/git/PR-REVIEW/b/systemtests/tests/python-bareos/test_python_fd_plugins.py", line 89, in test_additional_pluginoptions
361: jobid = self.run_job(
361: File "/home/pstorz/git/PR-REVIEW/systemtests/python-modules/bareos_unittest/json.py", line 103, in run_job
361: self.wait_job(director, jobId)
361: File "/home/pstorz/git/PR-REVIEW/systemtests/python-modules/bareos_unittest/json.py", line 91, in wait_job
361: self.assertEqual(result["job"]["jobstatuslong"], expected_status)
361: AssertionError: 'Fatal Error' != 'OK'
361: - Fatal Error
361: + OK
361:
361:
361: ======================================================================
361: FAIL: test_without_extra_pluginoptions (test_python_fd_plugins.BareosFdPythonPluginOptions)
361: ----------------------------------------------------------------------
361: Traceback (most recent call last):
361: File "/home/pstorz/git/PR-REVIEW/b/systemtests/tests/python-bareos/test_python_fd_plugins.py", line 55, in test_without_extra_pluginoptions
361: jobid = self.run_job(director, jobname, level="Full", wait=True)
361: File "/home/pstorz/git/PR-REVIEW/systemtests/python-modules/bareos_unittest/json.py", line 103, in run_job
361: self.wait_job(director, jobId)
361: File "/home/pstorz/git/PR-REVIEW/systemtests/python-modules/bareos_unittest/json.py", line 91, in wait_job
361: self.assertEqual(result["job"]["jobstatuslong"], expected_status)
361: AssertionError: 'Fatal Error' != 'OK'
361: - Fatal Error
361: + OK
361:
361:
361: ----------------------------------------------------------------------
361: Ran 3 tests in 6.685s
361:
361: FAILED (failures=2, expected failures=1)
361: ERROR:
361: ERROR:
361:
361: !!!!! python-bareos/test_python_fd_plugins failed!!! 12:05:21 !!!!!
361: Status: estat=9 zombie=0 backup=0 restore=0 diff=0
361:
2/3 Test #361: system:python-bareos:python_fd_plugins ...***Failed 6.94 sec
Co-authored-by: Philipp Storz <philipp.storz@bareos.com>
05842a0 to
870ad84
Compare
This is required for Python >= 3.10.
pstorz
requested changes
May 17, 2022
Member
pstorz
left a comment
There was a problem hiding this comment.
I have the following remarks:
- The Pluginoptions are in one line in the docs, while the multiline is much better readable.
- Last build failed, now waiting for next build.
| ":vcuser=bakadm@vsphere.local" | ||
| ":vcpass=Bak.Adm-1234" | ||
| ":localvmdk=yes" | ||
| "python:module_name=bareos-fd-vmware:dc=dass5:folder=/:vmname=stephand-test02:vcserver=virtualcenter5.dass-it:vcuser=bakadm@vsphere.local:vcpass=Bak.Adm-1234:localvmdk=yes" |
Member
There was a problem hiding this comment.
Don't we want to break the plugin options at the ":" as before? That makes things much better readable.
Member
Author
There was a problem hiding this comment.
This is a string that has to be typed during the restore command. I assume, splitting it over multiple lines is not an option, especially not in Bareos <= 15.2.3, as stated above.
But now that you point to it, I think, also the quoted around this string have to be removed.
The test was marked broken when the plugin was using psycopg2, but now we use pg8000 so we want to enable it again if all requirements are met. Also we allow python >= 3.10 to be used as we now avoid the problems arising from the fact that the stat time filds are floats instead of ints: > mystatp.st_atime = statp.st_atime > TypeError: 'float' object cannot be interpreted as an integer
12 tasks
pstorz
approved these changes
May 18, 2022
bruno-at-bareos
pushed a commit
to tuxmaster5000/bareos
that referenced
this pull request
Jul 4, 2022
This file contains hidden or 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
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.
This PR fixes a problem with handling additional pluginoptions, provided during a restore. When these are set, the plugin "forgets" about the Python module path.
Thank you for contributing to the Bareos Project!
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)
General
Source code quality
bareos-check-sources --since-mergedoes not report any problemsgit statusshould not report modifications in the source tree after building and testingTests