diff --git a/confluent_server/confluent/discovery/handlers/smm.py b/confluent_server/confluent/discovery/handlers/smm.py index 8f6564ac..d2922954 100644 --- a/confluent_server/confluent/discovery/handlers/smm.py +++ b/confluent_server/confluent/discovery/handlers/smm.py @@ -90,6 +90,13 @@ class NodeHandler(bmchandler.NodeHandler): smmip = smmip[-1][0] if smmip and ':' in smmip: raise exc.NotImplementedException('IPv6 not supported') + wc.request('POST', '/data', 'get=hostname') + rsp = wc.getresponse() + rspdata = fromstring(util.stringify(rsp.read())) + currip = rspdata.find('netConfig').find('ifConfigEntries').find( + 'ifConfig').find('v4IPAddr').text + if currip == smmip: + return netconfig = netutil.get_nic_config(cfg, nodename, ip=smmip) netmask = netutil.cidr_to_mask(netconfig['prefix']) setdata = 'set=ifIndex:0,v4DHCPEnabled:0,v4IPAddr:{0},v4NetMask:{1}'.format(smmip, netmask)