Skip to content

[BUG] autoenable cron job keeps complaining about pkg_resources being deprecated (from napalm) #3495

@lunkwill42

Description

@lunkwill42

Describe the bug

Since NAV 5.14, the autoenable script makes the following complaint on every invocation:

/opt/venvs/nav/lib/python3.9/site-packages/napalm/__init__.py:1: UserWarning:
pkg_resources is deprecated as an API. See
https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources
package is slated for removal as early as 2025-11-30. Refrain from using this
package or pin to Setuptools<81.
  import pkg_resources

Users that set up Arnold will often configure the autoenable script as a cron job to run every hour. This bug causes the above error to be send via e-mail from cron every hour of the day, and it becomes quite annoying, to say the least.

The error message is not due to a problem in NAV itself, but rather due to the Napalm library using the deprecated pkg_resources Python library. Napalm is potentially used by autoenable to re-enable ports blocked by Arnold after a set amount of time.

The best course of action is probably to upgrade the Napalm library (this issue was fixed in Napalm over the summer, see napalm-automation/napalm#2240 )

To Reproduce

Steps to reproduce the behavior:

  1. Run the autoenable program provided by NAV.
  2. See error.

Expected behavior

The autoenable program should be quiet unless it has an actual or important error to report.

Environment (please complete the following information):

  • NAV version installed: 5.14.1
  • Method of installation: from Debian package

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions