Skip to content

Commit

Permalink
network: do not pass None value from NM device object to dbus structu…
Browse files Browse the repository at this point in the history
…re holder (#1695967)
  • Loading branch information
rvykydal committed Apr 9, 2019
1 parent 1ee0606 commit 5e288d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pyanaconda/modules/common/structures/network.py
Expand Up @@ -113,10 +113,10 @@ def set_from_nm_device(self, device):
:param device: NetworkManager device object
:type device: NMDevice
"""
self._device_name = device.get_iface()
self._device_type = device.get_device_type()
self._device_name = device.get_iface() or ""
self._device_type = device.get_device_type() or self.DEVICE_TYPE_UNKNOWN
try:
hw_address = device.get_permanent_hw_address()
hw_address = device.get_permanent_hw_address() or ""
except AttributeError:
hw_address = device.get_hw_address()
hw_address = device.get_hw_address() or ""
self.hw_address = hw_address
5 changes: 5 additions & 0 deletions pyanaconda/modules/network/network.py
Expand Up @@ -423,6 +423,11 @@ def get_supported_devices(self):
if device.get_device_type() not in supported_device_types:
continue
dev_info = NetworkDeviceInfo()
log.debug("Setting NetworkDeviceInfo from NM device {} {} {}".format(
device.get_iface(),
device.get_device_type(),
device.get_hw_address()
))
dev_info.set_from_nm_device(device)
supported_devices.append(dev_info)

Expand Down

0 comments on commit 5e288d3

Please sign in to comment.