-
Notifications
You must be signed in to change notification settings - Fork 259
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
Bareos Python Plugins: fix handling of extra pluginoptions #1177
Bareos Python Plugins: fix handling of extra pluginoptions #1177
Conversation
98a87ba
to
ddec5cf
Compare
ddec5cf
to
015a4b1
Compare
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.
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.
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.
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" |
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.
Don't we want to break the plugin options at the ":" as before? That makes things much better readable.
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.
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
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-merge
does not report any problemsgit status
should not report modifications in the source tree after building and testingTests