From 5e406d6fa1a477ef57b87c32606674951d157415 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 13 Nov 2013 14:52:32 -0500 Subject: [PATCH] Have attribute set return some data Handle html form arrays with blanks, removing blank values (more complex usage requires JSON) --- confluent/httpapi.py | 3 ++- plugins/configuration/attributes.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/confluent/httpapi.py b/confluent/httpapi.py index f61a1f57..318f4757 100644 --- a/confluent/httpapi.py +++ b/confluent/httpapi.py @@ -59,7 +59,8 @@ def _get_query_dict(env, reqbody, reqtype): pbody = urlparse.parse_qs(reqbody, True) for ky in pbody.iterkeys(): if len(pbody[ky]) > 1: # e.g. REST explorer - qdict[ky] = pbody[ky] + na = [i for i in pbody[ky] if i != ''] + qdict[ky] = na else: qdict[ky] = pbody[ky][0] if 'restexplorerhonorkey' in qdict: diff --git a/plugins/configuration/attributes.py b/plugins/configuration/attributes.py index 58445a39..69323d0e 100644 --- a/plugins/configuration/attributes.py +++ b/plugins/configuration/attributes.py @@ -41,3 +41,4 @@ def update(nodes, element, configmanager, inputdata): if updatenode: updatedict[node] = updatenode configmanager.set_node_attributes(updatedict) + return retrieve(nodes, element, configmanager, inputdata)