netaddr should optionally use ieee data in /var/lib instead of /usr/share
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-netaddr (Ubuntu) |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
netaddr python package uses 2 files oui.txt and iab.txt to make mac address look up and others.
However, the files
/usr/lib/
/usr/lib/
are symlinks to, respectively,
/usr/share/
/usr/share/
from the package ieee-data.
But if you update the files with update-ieee-data, the updated files lies in /var/lib/ieee-data and not in /usr/share/
So the python package will continue to use the old ones.
The fix is simple. Use symlink towards
/var/lib/
/var/lib/
respectively instead
ProblemType: Bug
DistroRelease: Ubuntu 17.04
Package: python-netaddr 0.7.18-2
ProcVersionSign
Uname: Linux 4.10.0-33-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.4-0ubuntu4.5
Architecture: amd64
CurrentDesktop: Unity:Unity7
Date: Sun Sep 17 09:48:33 2017
InstallationDate: Installed on 2016-05-22 (482 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
PackageArchitec
SourcePackage: python-netaddr
UpgradeStatus: Upgraded to zesty on 2017-04-14 (155 days ago)
summary: |
- netaddr should use symlink in /var/lib instead of /usr/share + netaddr should optionally use ieee data in /var/lib instead of + /usr/share |
But what I describe above is not enough. Because netaddr module use index files, generated from oui.txt and iab.txt
So you need also to update those index files otherwise the mac vendor look up will be broken.
So I created symlinks in /usr/lib/ python2. 7/dist- packages/ netaddr/ eui for oui.idx and iab.idx towards /var/lib/ ieee-data/ oui.idx and /var/lib/ ieee-data/ iab.idx respectivelly.
Then used that python script to regenerate the index files
from netaddr.eui import ieee r('oui. idx') rser('oui. txt')
ouiidx = ieee.FileIndexe
oui = ieee.OUIIndexPa
oui.attach(ouiidx)
oui.parse()
oui.detach(ouiidx)
iabidx = ieee.FileIndexe r('iab. idx') rser('iab. txt')
iab = ieee.IABIndexPa
iab.attach(iabidx)
iab.parse()
iab.detach(iabidx)
I don't know how you could manage this at the package level ? But this is really needed