Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed AttributeError when using 'storage_groups' on 'Client' object #541

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Released: not yet

* Dev: Added missing development requirement for 'filelock' package.

* Fixed AttributeError when using 'storage_groups' on 'Client' object.

**Enhancements:**

* Docs: Added a section about the size of captured terminal output and log
Expand Down
8 changes: 7 additions & 1 deletion zhmc_prometheus_exporter/zhmc_prometheus_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,13 @@ def uri_to_resource(client, uri2resource, uri):
m = re.match(r'(/api/storage-groups/[a-f0-9\-]+)$', uri)
if m is not None:
# Resource URI is for a storage group
stogrp = client.storage_groups.resource_object(uri)
console = client.consoles.console
stogrp = console.storage_groups.resource_object(uri)
# Get the CPC via 'uri2resource()' because that avoids the
# "Get CPC Properties" operation that is performed when getting it
# via the 'cpc' property on the storage group object.
cpc_uri = stogrp.get_property('cpc-uri')
cpc = uri_to_resource(client, uri2resource, cpc_uri)
logprint(logging.INFO, PRINT_V,
"Adding storage group {}.{} after exporter start for "
"fast lookup".format(cpc.name, stogrp.name))
Expand Down
Loading