Commit 0941e532 authored by Łukasz Nowak's avatar Łukasz Nowak

format: Allow to log when tap has no name attribute

In some conditions there is no name attribute on tap, so allow real fallback
to interface name.
parent 8d5de1d0
...@@ -1320,7 +1320,7 @@ class Interface(object): ...@@ -1320,7 +1320,7 @@ class Interface(object):
# same network, try to add # same network, try to add
if self._addSystemAddress(addr, netmask, tap=tap): if self._addSystemAddress(addr, netmask, tap=tap):
# succeed, return it # succeed, return it
self._logger.info('Successfully added IPv6 %s to %s.' % (addr, tap.name or interface_name)) self._logger.info('Successfully added IPv6 %s to %s.' % (addr, getattr(tap, 'name', None) or interface_name))
return dict_addr_netmask return dict_addr_netmask
else: else:
self._logger.warning('Impossible to add old public IPv6 %s. ' self._logger.warning('Impossible to add old public IPv6 %s. '
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment