From 308db99dbbeba48b017c7ed252f3db5309ff566e Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 15 Mar 2018 12:09:45 -0400 Subject: [PATCH] Fix inconsistent dict member extension If two portions of a list come back piecewise from the plugin that are both lists, extend them rather than making a nested list. --- confluent_server/confluent/httpapi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/httpapi.py b/confluent_server/confluent/httpapi.py index e4fde6c6..81fb878d 100644 --- a/confluent_server/confluent/httpapi.py +++ b/confluent_server/confluent/httpapi.py @@ -741,7 +741,10 @@ def _assemble_json(responses, resource=None, url=None, extension=None): for dk in rsp.iterkeys(): if dk in rspdata: if isinstance(rspdata[dk], list): - rspdata[dk].append(rsp[dk]) + if isinstance(rsp[dk], list): + rspdata[dk].extend(rsp[dk]) + else: + rspdata[dk].append(rsp[dk]) else: rspdata[dk] = [rspdata[dk], rsp[dk]] else: