From d7d3ae344c22f69551133aaa48d2aa7fe1079b3b Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 5 Apr 2019 09:17:45 -0400 Subject: [PATCH] Skip empty nodes list A noderange based nodegroup would have the empty nodes list cluttering the output. Skip empty nodes list in current settings. --- .../confluent/plugins/configuration/attributes.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/plugins/configuration/attributes.py b/confluent_server/confluent/plugins/configuration/attributes.py index e9b3b1fc..8c37fd8f 100644 --- a/confluent_server/confluent/plugins/configuration/attributes.py +++ b/confluent_server/confluent/plugins/configuration/attributes.py @@ -74,6 +74,8 @@ def retrieve_nodegroup(nodegroup, element, configmanager, inputdata): for attribute in sorted(list(grpcfg)): currattr = grpcfg[attribute] if attribute == 'nodes': + if not currattr: + continue desc = 'The nodes belonging to this group' elif attribute == 'noderange': desc = 'A dynamic noderange that this group refers to in noderange expansion' @@ -97,8 +99,8 @@ def retrieve_nodegroup(nodegroup, element, configmanager, inputdata): kv={attribute: currattr}, desc=desc) else: - print attribute - print repr(currattr) + print(attribute) + print(repr(currattr)) raise Exception("BUGGY ATTRIBUTE FOR NODEGROUP")