From dc262c366c63ab9269b5d9260090c97e8ada4e31 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 9 Nov 2020 11:23:54 -0500 Subject: [PATCH] Fix false positive in affluent detection Make sure we don't receive a redirect or other when asking for mac tables. --- confluent_server/confluent/networking/macmap.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/networking/macmap.py b/confluent_server/confluent/networking/macmap.py index 291b31aa..915bf812 100644 --- a/confluent_server/confluent/networking/macmap.py +++ b/confluent_server/confluent/networking/macmap.py @@ -138,7 +138,9 @@ def _affluent_map_switch(args): wc = webclient.SecureHTTPConnection( switch, 443, verifycallback=kv, timeout=5) wc.set_basic_credentials(user, password) - macs = wc.grab_json_response('/affluent/macs/by-port') + macs, retcode = wc.grab_json_response_with_status('/affluent/macs/by-port') + if retcode != 200: + raise Exception("No affluent detected") _macsbyswitch[switch] = macs for iface in macs: