def DeviceGroupProtocolStackNgpfPy(deviceGroup, ipType): # This Proc is an internal API for VerifyArpNgpf. # It's created because each deviceGroup has IPv4/IPv6 and # a deviceGroup could have inner deviceGroup that has IPv4/IPv6. # Therefore, you can loop device groups. import re unresolvedArpList = [] for ethernet in ixNet.getList(deviceGroup, 'ethernet'): for ipProtocol in ixNet.getList(ethernet, ipType): resolvedGatewayMac = ixNet.getAttribute(ipProtocol, '-resolvedGatewayMac') for index in range(0, len(resolvedGatewayMac)): if (bool(re.match('.*Unresolved.*', resolvedGatewayMac[index]))): multivalueNumber = ixNet.getAttribute(ipProtocol, '-address') srcIpAddrNotResolved = ixNet.getAttribute(ixNet.getRoot()+multivalueNumber, '-values')[index] print '\tFailed to resolveARP:', srcIpAddrNotResolved unresolvedArpList.append(srcIpAddrNotResolved) if unresolvedArpList == []: print '\tARP is resolved' return 0 else: return unresolvedArpList