updating api checks
@@ -100,6 +100,7 @@ class Nodes():
if 'ipv4' in node:
try:
ipv4 = endpoint_data['ipv4']
+ if isinstance(ipv4, str) and ipv4 != 'None':
if 'ipv4_subnet' in node:
if '.' in ipv4:
node['ipv4_subnet'] = '.'.join(
@@ -115,6 +116,7 @@ class Nodes():
if 'ipv6' in node:
try:
ipv6 = endpoint_data['ipv6']
+ if isinstance(ipv6, str) and ipv6 != 'None':
if 'ipv6_subnet' in node:
if ':' in ipv6:
node['ipv6_subnet'] = ':'.join(
@@ -165,8 +167,13 @@ class NetworkFull(object):
@staticmethod
def get_dataset():
- fields = {'mac': 0, 'id': 'UNDEFINED', 'ipv4': 0, 'ipv6': 0, 'ipv4_subnet': 'UNDEFINED', 'ipv6_subnet': 'UNDEFINED', 'segment': 0, 'port': 0, 'tenant': 0, 'active': 0,
- 'state': 'UNDEFINED', 'prev_states': 'UNDEFINED', 'role': 'UNDEFINED', 'role_confidence': 0, 'behavior': 0, 'ipv4_os': 'UNDEFINED', 'ipv6_os': 'UNDEFINED', 'source': 'UNDEFINED'}
+ fields = {'mac': 0, 'id': 'UNDEFINED', 'ipv4': 0, 'ipv6': 0,
+ 'ipv4_subnet': 'UNDEFINED', 'ipv6_subnet': 'UNDEFINED',
+ 'segment': 0, 'port': 0, 'tenant': 0, 'active': 0,
+ 'next_state': 'UNDEFINED', 'state': 'UNDEFINED',
+ 'prev_states': 'UNDEFINED', 'role': 'UNDEFINED',
+ 'role_confidence': 0, 'behavior': 0, 'ipv4_os': 'UNDEFINED',
+ 'ipv6_os': 'UNDEFINED', 'source': 'UNDEFINED'}
n = Nodes(fields)
n.build_nodes()
return n.nodes
