From 64cfad09affc2bc9d947e7c08f82026075d54d6b Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Mon, 27 Jul 2026 01:52:09 +0200 Subject: [PATCH] Complete the async port of the nodegroup attribute paths simple_nodegroups_command awaited the async generators returned by read and update, which raises TypeError: 'async_generator' object can't be awaited and printgroupattributes was left synchronous, iterating one of those generators with plain for. Neither is reachable yet, since nodeattrib only ever passes a noderange and nodegroupattrib still uses the traditional client, but they are the paths nodegroupattrib will use once it is ported. --- confluent_client/confluent/asynclient.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/confluent_client/confluent/asynclient.py b/confluent_client/confluent/asynclient.py index 79b4308f..1064a2aa 100644 --- a/confluent_client/confluent/asynclient.py +++ b/confluent_client/confluent/asynclient.py @@ -347,12 +347,12 @@ class Command(object): else: ikey = key if input is None: - for res in await self.read('/nodegroups/{0}/{1}'.format( + async for res in self.read('/nodegroups/{0}/{1}'.format( noderange, resource)): rc = self.handle_results(ikey, rc, res) else: kwargs[ikey] = input - for res in await self.update('/nodegroups/{0}/{1}'.format( + async for res in self.update('/nodegroups/{0}/{1}'.format( noderange, resource), kwargs): rc = self.handle_results(ikey, rc, res) return rc @@ -667,10 +667,10 @@ def show_attr(attr, requestargs, seenattributes, options, node): return processattr -def printgroupattributes(session, requestargs, showtype, nodetype, noderange, options): +async def printgroupattributes(session, requestargs, showtype, nodetype, noderange, options): exitcode = 0 seenattributes = set([]) - for res in session.read('/{0}/{1}/attributes/{2}'.format(nodetype, noderange, showtype)): + async for res in session.read('/{0}/{1}/attributes/{2}'.format(nodetype, noderange, showtype)): if 'error' in res: sys.stderr.write(res['error'] + '\n') exitcode = 1