From: John Mulligan Date: Fri, 9 Jan 2026 16:12:46 +0000 (-0500) Subject: qa/tasks: add client node info to smb workunit config dump X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=db05a1a89f30d409472b695808323fcc6022f397;p=ceph.git qa/tasks: add client node info to smb workunit config dump When generating the big ball of config JSON that helps define parameters for the smb tests in the workunit add client "node" info as well. Add a function to avoid repeating the logic of getting node info from the teuthology remote object. Signed-off-by: John Mulligan --- diff --git a/qa/tasks/smb.py b/qa/tasks/smb.py index ea226cc1aae1..691b33677e16 100644 --- a/qa/tasks/smb.py +++ b/qa/tasks/smb.py @@ -383,6 +383,16 @@ def workunit(ctx, config): return workunit.task(ctx, _config) +def _node_info(ctx, role_name, **kwargs): + (remote,) = ctx.cluster.only(role_name).remotes.keys() + info = dict(remote.inventory_info) + info['_role_name'] = role_name + info['shortname'] = remote.shortname + info['ip_address'] = remote.ip_address + info.update(kwargs) + return info + + @contextlib.contextmanager def write_metadata_file(ctx, config, *, roles=None): obj = { @@ -395,18 +405,16 @@ def write_metadata_file(ctx, config, *, roles=None): } if config.get('admin_node'): role = config.get('admin_node') - (remote,) = ctx.cluster.only(role).remotes.keys() - n = obj['admin_node'] = remote.inventory_info - n['shortname'] = remote.shortname - n['ip_address'] = remote.ip_address + obj['admin_node'] = _node_info(ctx, role) if config.get('smb_nodes'): - snodes = obj['smb_nodes'] = [] - for node in config.get('smb_nodes'): - (remote,) = ctx.cluster.only(node).remotes.keys() - n = dict(remote.inventory_info) - n['shortname'] = remote.shortname - n['ip_address'] = remote.ip_address - snodes.append(n) + obj['smb_nodes'] = [ + _node_info(ctx, node) for node in config.get('smb_nodes') + ] + if config.get('clients'): + obj['client_nodes'] = [ + _node_info(ctx, node, client_name=node) + for node in config.get('clients') + ] data = json.dumps(obj) log.debug('smb metadata: %r', obj)