2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 17:43:14 +00:00

Deal with normal generator from a plugin

This commit is contained in:
Jarrod Johnson 2024-05-07 17:01:04 -04:00
parent b3e0117944
commit 2089f5e7e6

View File

@ -83,13 +83,15 @@ async def iterate_responses(responses):
if inspect.isasyncgen(responses):
async for rsp in responses:
yield rsp
elif inspect.isgenerator(responses):
return
elif inspect.isgenerator(responses) or isinstance(responses, list) or isinstance(responses, tuple):
for rsp in responses:
yield rsp
return
elif inspect.isawaitable(responses):
responses = await responses
for rsp in responses:
yield rsp
for rsp in responses:
yield rsp
def seek_element(currplace, currkey, depth):
@ -1307,7 +1309,7 @@ async def handle_path(path, operation, configmanager, inputdata=None, autostrip=
return await handle_node_request(configmanager, inputdata,
operation, pathcomponents, autostrip)
elif pathcomponents[0] == 'discovery':
return disco.handle_api_request(
return await disco.handle_api_request(
configmanager, inputdata, operation, pathcomponents)
elif pathcomponents[0] == 'networking':
return macmap.handle_api_request(