Skip to content

Commit

Permalink
[resotocore][fix] User warning for iterating streams (#1771)
Browse files Browse the repository at this point in the history
  • Loading branch information
aquamatthias committed Sep 8, 2023
1 parent 5773b50 commit 1a80472
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion resotocore/resotocore/report/inspector_service.py
Expand Up @@ -252,12 +252,16 @@ async def perform_cmd(cmd: str) -> AsyncIterator[Json]:
for result in cli_result[0]:
yield result

async def empty() -> AsyncIterator[Json]:
if False: # pylint: disable=using-constant-test
yield {} # noqa

if resoto_search := inspection.detect.get("resoto"):
return perform_search(resoto_search)
elif resoto_cmd := inspection.detect.get("resoto_cmd"):
return perform_cmd(resoto_cmd)
else:
return stream.empty() # type: ignore
return empty()

async def __perform_benchmark(
self, benchmark: Benchmark, graph: GraphName, context: CheckContext
Expand Down

0 comments on commit 1a80472

Please sign in to comment.