network_device_info.py traceback when running and a device is not configured for IPv4

Bug #1850652 reported by Jeff Lane 
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox Provider - Base
Fix Released
High
Jeff Lane 

Bug Description

---------------------------[ Devices found by udev ]----------------------------
Category: NETWORK
Interface: enp1s0f0
Product: I350 Gigabit Network Connection
Vendor: Intel Corporation
Driver: igb
Driver Version: 5.4.0-k
Path: /devices/pci0000:00/0000:00:01.0/0000:01:00.0
Id: [8086:1521]
Subsystem Id: [1137:00d5]
Mac: 70:e4:22:83:64:50
Carrier Status: Connected
Ipv4: 10.193.36.103
Ipv6: fe80::72e4:22ff:fe83:6450/64
Speed: 1000

Traceback (most recent call last):
  File "/tmp/nest-7umvifvs.0a6fd5df593a8d7f8f0309fb5ecefc78386b499efc2ca17cb9dc44b4fc6c5396/network_device_info.py", line 365, in <module>
    for device in udev.devices():
  File "/tmp/nest-7umvifvs.0a6fd5df593a8d7f8f0309fb5ecefc78386b499efc2ca17cb9dc44b4fc6c5396/network_device_info.py", line 311, in devices
    nd.interface = getattr(device, 'interface', None)
  File "/tmp/nest-7umvifvs.0a6fd5df593a8d7f8f0309fb5ecefc78386b499efc2ca17cb9dc44b4fc6c5396/network_device_info.py", line 141, in interface
    self._interface_populate()
  File "/tmp/nest-7umvifvs.0a6fd5df593a8d7f8f0309fb5ecefc78386b499efc2ca17cb9dc44b4fc6c5396/network_device_info.py", line 215, in _interface_populate
    self._ipv4 = Utils.get_ipv4_address(self.interface)
  File "/tmp/nest-7umvifvs.0a6fd5df593a8d7f8f0309fb5ecefc78386b499efc2ca17cb9dc44b4fc6c5396/network_device_info.py", line 55, in get_ipv4_address
    struct.pack('256s', interface[:15].encode())
OSError: [Errno 99] Cannot assign requested address

This happens because the next interface in the list does not have an IPv4 address, and this creates a traceback in Utils.get_ipv4_address() in the script.

Tags: scripts

Related branches

Changed in plainbox-provider-checkbox:
milestone: 0.50.0 → 0.51.0
Changed in plainbox-provider-checkbox:
status: In Progress → Fix Committed
milestone: 0.51.0 → 0.50.0
Changed in plainbox-provider-checkbox:
status: Fix Committed → Fix Released
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.