From 7413c44df81524f16928e89e6a80426ddb3e7d84 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 14 Mar 2018 09:27:29 -0400 Subject: [PATCH] Fix manual discovery In manual discovery, maccount is not a field in the info, as no macmap processing is done in manual. --- confluent_server/confluent/discovery/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/discovery/core.py b/confluent_server/confluent/discovery/core.py index 16e9a364..0b7523a2 100644 --- a/confluent_server/confluent/discovery/core.py +++ b/confluent_server/confluent/discovery/core.py @@ -924,7 +924,7 @@ def eval_node(cfg, handler, info, nodename, manual=False): # but... is this really ok? could be on an upstream port or # erroneously put in the enclosure with no nodes yet # so first, see if the candidate node is a chain host - if info['maccount']: + if info.get('maccount', False): # discovery happened through switch nl = list(cfg.filter_node_attributes( 'enclosure.extends=' + nodename)) @@ -934,7 +934,7 @@ def eval_node(cfg, handler, info, nodename, manual=False): macmap.get_node_fingerprint(nodename, cfg) util.handler.cert_matches(fprint, handler.https_cert) return - if (info['maccount'] and + if (info.get('maccount', False) and not handler.discoverable_by_switch(info['maccount'])): errorstr = 'The detected node {0} was detected using switch, ' \ 'however the relevant port has too many macs learned ' \