From 80864d78b3be9dad785b0831df6a0fcaa9c5b253 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 8 Nov 2017 13:36:36 -0500 Subject: [PATCH] Remove unused nestedmode Without the ability to reliably tell a nodename from an input key, must not do the nestedmode detection. --- confluent_server/confluent/messages.py | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/confluent_server/confluent/messages.py b/confluent_server/confluent/messages.py index e81060e4..b89f4505 100644 --- a/confluent_server/confluent/messages.py +++ b/confluent_server/confluent/messages.py @@ -446,23 +446,13 @@ class InputExpression(ConfluentMessage): # so that it can make it intact to the pertinent configmanager function def __init__(self, path, inputdata, nodes=None): self.nodeattribs = {} - nestedmode = False if not inputdata: raise exc.InvalidArgumentException('no request data provided') if nodes is None: self.attribs = inputdata return for node in nodes: - if node in inputdata: - nestedmode = True - self.nodeattribs[node] = inputdata[node] - if nestedmode: - for key in inputdata: - if key not in nodes: - raise exc.InvalidArgumentException - else: - for node in nodes: - self.nodeattribs[node] = inputdata + self.nodeattribs[node] = inputdata def get_attributes(self, node): if node not in self.nodeattribs: @@ -484,7 +474,6 @@ class InputAttributes(ConfluentMessage): # to the client def __init__(self, path, inputdata, nodes=None): self.nodeattribs = {} - nestedmode = False if not inputdata: raise exc.InvalidArgumentException('no request data provided') if nodes is None: @@ -509,16 +498,7 @@ class InputAttributes(ConfluentMessage): 'expression': self.attribs[attrib]} return for node in nodes: - if node in inputdata: - nestedmode = True - self.nodeattribs[node] = inputdata[node] - if nestedmode: - for key in inputdata: - if key not in nodes: - raise exc.InvalidArgumentException - else: - for node in nodes: - self.nodeattribs[node] = inputdata + self.nodeattribs[node] = inputdata def get_attributes(self, node): if node not in self.nodeattribs: @@ -555,7 +535,6 @@ class InputCredential(ConfluentMessage): def __init__(self, path, inputdata, nodes=None): self.credentials = {} - nestedmode = False if not inputdata: raise exc.InvalidArgumentException('no request data provided')