From b079421b7b46b41c912dff41ba579e0769bd2610 Mon Sep 17 00:00:00 2001 From: Andreas Maier Date: Tue, 30 Jul 2024 17:46:11 +0200 Subject: [PATCH] Fixed AttributeError when adding NICs after intial startup Signed-off-by: Andreas Maier --- docs/changes.rst | 2 ++ zhmc_prometheus_exporter/zhmc_prometheus_exporter.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/changes.rst b/docs/changes.rst index baa07321..930a7e8a 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -49,6 +49,8 @@ Released: not yet - Fixed vulnerabilities in Prometheus server detected by testssl.sh. (issues #508, #509) +* Fixed AttributeError when adding NICs after intial startup. + **Enhancements:** * Docs: Added a section about the size of captured terminal output and log diff --git a/zhmc_prometheus_exporter/zhmc_prometheus_exporter.py b/zhmc_prometheus_exporter/zhmc_prometheus_exporter.py index bfecc86e..2f988eca 100755 --- a/zhmc_prometheus_exporter/zhmc_prometheus_exporter.py +++ b/zhmc_prometheus_exporter/zhmc_prometheus_exporter.py @@ -1106,8 +1106,8 @@ def uri_to_resource(client, uri2resource, uri): if m is not None: # Resource URI is for a NIC partition_uri = m.group(1) - partition_props = client.get(partition_uri) - cpc_uri = partition_props.properties['parent'] + partition_props = client.session.get(partition_uri) + cpc_uri = partition_props['parent'] cpc = client.cpcs.resource_object(cpc_uri) partition = cpc.partitions.resource_object(partition_uri) nic = partition.nics.resource_object(uri)