From 43fb4467b7bd0a754b00ce128b25a16996b24647 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 2 Nov 2018 15:56:34 -0400 Subject: [PATCH] Add error if chain goes off into non-existent nodes Various behaviors break if the administrator declares a chain goes to nowhere, throw up an error and hopefully see it caught to detect this misconfiguration. --- confluent_server/confluent/discovery/core.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/confluent_server/confluent/discovery/core.py b/confluent_server/confluent/discovery/core.py index d2e8b96c..cbf625cf 100644 --- a/confluent_server/confluent/discovery/core.py +++ b/confluent_server/confluent/discovery/core.py @@ -691,6 +691,10 @@ def get_enclosure_chain_head(nodename, cfg): if ne in members: raise exc.InvalidArgumentException( 'Circular chain that includes ' + nodename) + if not cfg.is_node(ne): + raise exc.InvalidArgumentException( + '{0} is chained to nonexistent node {1} '.format( + nodename, ne)) nodename = ne members.append(nodename) return nodename