Skip to content
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

python-bareos: use socket.create_connection() to allow AF_INET6 #1646

Conversation

bruno-at-bareos
Copy link
Contributor

@bruno-at-bareos bruno-at-bareos commented Dec 27, 2023

This PR remove the hard-coded restriction on AF_INET Familly by using use a higher-level function socket.create_connection() .
This allow connection to bareos daemon with AF_INET6 familly.

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

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
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
    Check backport line
  • Required backport PRs have been created
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR

@bruno-at-bareos bruno-at-bareos force-pushed the dev/bruno/master/fix-python-bareos-add-af6_familly-support branch 2 times, most recently from c1a1655 to 608ee5c Compare December 27, 2023 14:34
@bruno-at-bareos bruno-at-bareos force-pushed the dev/bruno/master/fix-python-bareos-add-af6_familly-support branch 2 times, most recently from 0908e88 to 7c36267 Compare January 4, 2024 09:03
@bruno-at-bareos bruno-at-bareos force-pushed the dev/bruno/master/fix-python-bareos-add-af6_familly-support branch from 7c36267 to 677e15f Compare January 4, 2024 12:09
Copy link
Contributor

@sebsura sebsura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great change. I added some comments for things i would change.

python-bareos/bareos/bsock/lowlevel.py Outdated Show resolved Hide resolved
python-bareos/bareos/bsock/lowlevel.py Outdated Show resolved Hide resolved
Copy link
Contributor

@sebsura sebsura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work!

@sebsura
Copy link
Contributor

sebsura commented Jan 8, 2024

pr-tool reported the following:

bareos-check-sources --since=57b632d413b4f2c681c842fbc96dfdbea88fb730 reported:
  Plugin 'fix copyright year' would modify 'python-bareos/bareos/bsock/lowlevel.py'
  Plugin 'python black' would modify 'python-bareos/bareos/bsock/lowlevel.py'

@bruno-at-bareos bruno-at-bareos force-pushed the dev/bruno/master/fix-python-bareos-add-af6_familly-support branch 3 times, most recently from ba7d452 to f98477b Compare January 8, 2024 13:19
bruno-at-bareos and others added 2 commits January 8, 2024 14:05
- remove hard-coded AF_INET in socket creation.
- replace socket.connect() by a higher-level function
  socket.create_connection() allowing AF_INET6 familly connection.
- set a default of 30 to self.timeout, simplify code to remove
  `if self.timeout ...`

Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
Co-authored-by: Sebastian Sura <124262655+sebsura@users.noreply.github.com>
@BareosBot BareosBot force-pushed the dev/bruno/master/fix-python-bareos-add-af6_familly-support branch from b435feb to 5ab0d6c Compare January 8, 2024 14:05
@BareosBot BareosBot merged commit 115b3eb into bareos:master Jan 8, 2024
@bruno-at-bareos bruno-at-bareos deleted the dev/bruno/master/fix-python-bareos-add-af6_familly-support branch January 15, 2024 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants