Avoid problems when nis is not available on a system.

Review Request #12865 — Created March 3, 2023 and submitted — Latest diff uploaded

Information

Review Board
release-5.0.x

Reviewers

The NIS backend assumes that it can safely import the nis module.
However, this isn't always present on Python, and will be removed in
Python 3.13.

This change checks for this, attempting an import and logging if it
fails. The rest of the code will avoid trying to use the module if it's
not available, avoiding a crash.

This was hit in CI, where our Python 3.11 does not appear to ship with
NIS support.

Unit tests pass, with and without nis.

Diff Revision 1

This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.

orig
1
2

Commits

First Last Summary ID Author
Avoid problems when nis is not available on a system.
The NIS backend assumes that it can safely import the `nis` module. However, this isn't always present on Python, and will be removed in Python 3.13. This change checks for this, attempting an import and logging if it fails. The rest of the code will avoid trying to use the module if it's not available, avoiding a crash. This was hit in CI, where our Python 3.11 does not appear to ship with NIS support.
b77aea15c524dad7f3e942f693cf7cc2651a9217 Christian Hammond
reviewboard/accounts/backends/nis.py
reviewboard/accounts/tests/test_nis_auth_backend.py
reviewboard/scmtools/bzr/__init__.py
Loading...