From 804d4c2d95e1afa2d92daef25aa0b79fc8121d86 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 6 Nov 2015 11:55:13 -0500 Subject: [PATCH] Correct dynamic group behavior Expansion of a noderange containing a dynamic group would erroneously make the dynamic members get promoted to 'permament' members. Fix this by isolating the change so that the underlying group config is not changed just by adding in dynamic nodes. --- confluent_server/confluent/noderange.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/noderange.py b/confluent_server/confluent/noderange.py index c61ee5d7..1899e6f2 100644 --- a/confluent_server/confluent/noderange.py +++ b/confluent_server/confluent/noderange.py @@ -20,6 +20,7 @@ # the middle of strings and use of @ for anything is not in their syntax +import copy import itertools import pyparsing as pp import re @@ -160,7 +161,7 @@ class NodeRange(object): return set([entname]) if self.cfm.is_nodegroup(entname): grpcfg = self.cfm.get_nodegroup_attributes(entname) - nodes = grpcfg['nodes'] + nodes = copy.copy(grpcfg['nodes']) if 'noderange' in grpcfg and grpcfg['noderange']: nodes |= NodeRange( grpcfg['noderange']['value'], self.cfm).nodes @@ -185,7 +186,7 @@ class NodeRange(object): return set([element]) if self.cfm.is_nodegroup(element): grpcfg = self.cfm.get_nodegroup_attributes(element) - nodes = grpcfg['nodes'] + nodes = copy.copy(grpcfg['nodes']) if 'noderange' in grpcfg and grpcfg['noderange']: nodes |= NodeRange( grpcfg['noderange']['value'], self.cfm).nodes