Comment 18 for bug 1466148

Revision history for this message
Andrew Woodward (xarses) wrote :

bug appears to be from

diff --git a/nailgun/nailgun/network/manager.py b/nailgun/nailgun/network/manager.py
index 9f036ce..09653a6 100644
--- a/nailgun/nailgun/network/manager.py
+++ b/nailgun/nailgun/network/manager.py
@@ -874,7 +874,7 @@ class NetworkManager(object):
                          'network group on %s', node.full_name)

         for interface in node.nic_interfaces:
- if cls.is_ip_belongs_to_admin_subnet(interface.ip_addr):
+ if cls.is_ip_belongs_to_admin_subnet(interface.ip_addr, node.id):
                 return interface

         logger.warning(u'Cannot find admin interface for node '

>>> for i in n.nic_interfaces: print nm.is_ip_belongs_to_admin_subnet(i.ip_addr, n.id), i.name
...
False eth0
False eth1
False eth2
False eth3
True eth4
>>> for i in n.nic_interfaces: print nm.is_ip_belongs_to_admin_subnet(i.ip_addr), i.name
...
False eth0
False eth1
False eth2
False eth3
False eth4
>>>

but after adding node id to is_ip_belongs_to_admin_subnet it still didn't assign to the right interface