From 8797189d5ccb66c76b076cea5cec913f629bc849 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 3 Jun 2020 10:11:46 -0400 Subject: [PATCH] Reduce sensing responses Do not respond to a node if we do not have any expectation of deploying to that system. Mitigates troubles of having multiple confluent servers with the same nodes. --- confluent_server/confluent/discovery/protocols/ssdp.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/confluent_server/confluent/discovery/protocols/ssdp.py b/confluent_server/confluent/discovery/protocols/ssdp.py index c3f4ab7e..514b991d 100644 --- a/confluent_server/confluent/discovery/protocols/ssdp.py +++ b/confluent_server/confluent/discovery/protocols/ssdp.py @@ -28,6 +28,7 @@ # NTS: ssdp:alive +import confluent.config.configmanager as cfm import confluent.neighutil as neighutil import confluent.util as util import confluent.log as log @@ -173,6 +174,15 @@ def snoop(handler, byehandler=None, protocol=None, uuidlookup=None): node = uuidlookup(curruuid) if not node: break + # Do not bother replying to a node that + # we have no deployment activity + # planned for + cfg = cfm.ConfigManager(None) + cfd = cfg.get_node_attributes( + node, 'deployment.pendingprofile') + if not cfd.get(node, {}).get( + 'deployment.pendingprofile', {}).get('value', None): + break currtime = time.time() seconds = int(currtime) msecs = int(currtime * 1000 % 1000)