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.

Changes between revision 1 and 2

orig
1
2

Commits

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
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.
1272cc2897ebb9f8018c236820747c3e5fa6ef1e Christian Hammond
reviewboard/scmtools/bzr/__init__.py
Loading...