← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1801030] [NEW] neutron-macvtap-agent fails to start due to interface not having a mac address

 

Public bug reported:

The same as for linuxbridge-agent:
https://bugs.launchpad.net/neutron/+bug/1669087

diff --git a/neutron/plugins/ml2/drivers/macvtap/agent/macvtap_neutron_agent.py b/neutron/plugins/ml2/drivers/macvtap/agent/macvtap_neutron_agent.py
index 3a771fbba7..7119d7d2f6 100644
--- a/neutron/plugins/ml2/drivers/macvtap/agent/macvtap_neutron_agent.py
+++ b/neutron/plugins/ml2/drivers/macvtap/agent/macvtap_neutron_agent.py
@@ -112,13 +112,15 @@ class MacvtapManager(amb.CommonAgentManagerBase):

     def get_agent_id(self):
         devices = ip_lib.IPWrapper().get_devices(True)
-        if devices:
-            mac = ip_lib.get_device_mac(devices[0].name)
-            return 'macvtap%s' % mac.replace(":", "")
+        for device in devices:
+            mac = ip_lib.get_device_mac(device.name)
+            if mac:
+                break
         else:
             LOG.error("Unable to obtain MAC address for unique ID. "
                       "Agent terminated!")
             sys.exit(1)
+        return 'macvtap%s' % mac.replace(":", "")

     def get_devices_modified_timestamps(self, devices):
         # TODO(kevinbenton): this should be implemented to detect

** Affects: neutron
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1801030

Title:
  neutron-macvtap-agent fails to start due to interface not having a mac
  address

Status in neutron:
  New

Bug description:
  The same as for linuxbridge-agent:
  https://bugs.launchpad.net/neutron/+bug/1669087

  diff --git a/neutron/plugins/ml2/drivers/macvtap/agent/macvtap_neutron_agent.py b/neutron/plugins/ml2/drivers/macvtap/agent/macvtap_neutron_agent.py
  index 3a771fbba7..7119d7d2f6 100644
  --- a/neutron/plugins/ml2/drivers/macvtap/agent/macvtap_neutron_agent.py
  +++ b/neutron/plugins/ml2/drivers/macvtap/agent/macvtap_neutron_agent.py
  @@ -112,13 +112,15 @@ class MacvtapManager(amb.CommonAgentManagerBase):

       def get_agent_id(self):
           devices = ip_lib.IPWrapper().get_devices(True)
  -        if devices:
  -            mac = ip_lib.get_device_mac(devices[0].name)
  -            return 'macvtap%s' % mac.replace(":", "")
  +        for device in devices:
  +            mac = ip_lib.get_device_mac(device.name)
  +            if mac:
  +                break
           else:
               LOG.error("Unable to obtain MAC address for unique ID. "
                         "Agent terminated!")
               sys.exit(1)
  +        return 'macvtap%s' % mac.replace(":", "")

       def get_devices_modified_timestamps(self, devices):
           # TODO(kevinbenton): this should be implemented to detect

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1801030/+subscriptions


Follow ups