2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-26 11:30:23 +00:00

Force asyncresponse http to be JSON array

Rather than let it be ambiguous, force it to provide a JSON array.
This commit is contained in:
Jarrod Johnson 2016-03-20 13:53:06 -04:00
parent 2b3d5f7b62
commit 3cd96a4f59
2 changed files with 6 additions and 5 deletions

View File

@ -634,7 +634,7 @@ def _assemble_json(responses, resource=None, url=None, extension=None):
else:
rspdata[dk] = [rspdata[dk], rsp[dk]]
else:
if dk == 'databynode':
if dk == 'databynode' or dk == 'asyncresponse':
# a quirk, databynode suggests noderange
# multi response. This should *always* be a list,
# even if it will be length 1

View File

@ -489,8 +489,8 @@ class InputCredential(ConfluentMessage):
if node not in self.credentials:
return {}
credential = self.credentials[node]
for attr in credentials:
if type(credentials[attr]) in (str, unicode):
for attr in credential:
if type(credential[attr]) in (str, unicode):
try:
# as above, use format() to see if string follows
# expression, store value back in case of escapes
@ -843,6 +843,7 @@ class AsyncCompletion(ConfluentMessage):
def raw(self):
return {'_requestdone': True}
class AsyncMessage(ConfluentMessage):
def __init__(self, pair):
self.stripped = True
@ -851,8 +852,8 @@ class AsyncMessage(ConfluentMessage):
def raw(self):
return {'asyncresponse':
{'requestid': self.msgpair[0],
'response': self.msgpair[1].raw()}}
{'requestid': self.msgpair[0],
'response': self.msgpair[1].raw()}}
class AsyncSession(ConfluentMessage):
def __init__(self, id):