Unmaintained dependency: netifaces

Bug #2019233 reported by Tim Burke
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
In Progress
Undecided
Tim Burke

Bug Description

For more than ten years (since https://opendev.org/openstack/swift/commit/e0987d60 merged) Swift has had a dependency on netifaces -- we use it to determine a node's own IP addresses when using servers_per_port, as the ports to bind need to be looked up in the ring(s).

Roughly two years ago, however, that project was archived: see the notice at https://github.com/al45tair/netifaces

This has also been discussed on the ML: https://lists.openstack.org/pipermail/openstack-discuss/2023-April/033261.html

Tim Burke (1-tim-z)
Changed in swift:
assignee: nobody → Tim Burke (1-tim-z)
Revision history for this message
Tim Burke (1-tim-z) wrote :

One alternative brought up is https://pypi.org/project/ifaddr/

I wonder if we actually need all the features offered, though -- we don't actually care about the network adapters themselves. Perhaps we could use ctypes to call getifaddrs() ourselves; I believe it should be available on all the platforms we care about. Even if it isn't, we could still fall back to netifaces for now, with a warning about how that fallback behavior will be removed in the future -- and encourage operators to report it if they see the warning.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/swift/+/883035

Changed in swift:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.opendev.org/c/openstack/swift/+/873222
Committed: https://opendev.org/openstack/swift/commit/23fa18d3021fb44d8b4dd81890d9c355eed9426f
Submitter: "Zuul (22348)"
Branch: master

commit 23fa18d3021fb44d8b4dd81890d9c355eed9426f
Author: Tim Burke <email address hidden>
Date: Mon May 22 10:37:12 2023 -0700

    Remove hard dependency on netifaces

    The project was archived in 2021, and we can fairly easily replace it
    with some ctypes code to call getifaddrs ourselves.

    Be willing to fall back to netifaces (with a warning) in case getifaddrs
    is not available, but I'm fairly certain it will be for all platforms we
    support.

    Could maybe use some more testing on big-endian arches / BSDs, but an
    attempt was at least made at supporting them.

    Partial-Bug: #2019233
    Change-Id: I1189a60204cf96c291619f8d8ec957ed8a5be1ce

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.