• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zhmcclient / zhmc-ansible-modules / test-2771

23 Aug 2025 02:12PM UTC coverage: 42.03% (+0.2%) from 41.831%
test-2771

push

github

andy-maier
Tolerate referenced objects without access permission

Details:

* Fixed that resource objects for which the user has no access permission but
  that are referenced via URIs in other objects do not cause errors anymore.
  Such cases are now tolerated and the referenced objects are shown with their
  URI, with name "(unknown)" and with 'None' for their properties in any module
  results that show objects. (issue #1173)

* This was done by adding lookup support in the common.py module:

  - A constant UNKNOWN_NAME = "(unknown)" that defines what is shown for the
    name of such objects.

  - Functions object_from_uri(), object_name(), object_properties() that
    look up a resource object from a single URI by constructing it locally
    and then pulling its properties, if needed. The object_name() and
    object_properties() functions implement the behavior described above.

  - A class ObjectsByUriCache that look up resource objects from a single URI
    or list of URIs by listing all resource objects on a particular manager.
    The properties are pulled only when needed.

* The following modules were changed to use this new lookup support:

  - zhmc_crypto_attachment.py with state=attached, when showing the conflicting
    domains.

  - zhmc_partition.py with all states that show the partition in the result,
    when showing attached storage groups.

  - zhmc_user.py and zhmc_user_list.py with all states that show users in
    the result, when showing objects referenced by the user, such as:
    User roles, user pattern, user template, password rule, LDAP server
    definition, primary and backup MFA server definition, and default group.

Signed-off-by: Andreas Maier <maiera@de.ibm.com>

59 of 169 new or added lines in 5 files covered. (34.91%)

6 existing lines in 4 files now uncovered.

2700 of 6424 relevant lines covered (42.03%)

3.78 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

42.47
/plugins/module_utils/common.py


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc