ansible-collections/vmware.vmware_rest

vmware.vmware_rest.content_library_item_info gives "Unsupported property with name: library_id?library_id." error

Bergdolt opened this issue · 2 comments

SUMMARY

Invoking vmware_rest.content_library_item_info gives error "Unsupported property with name: library_id?library_id."

ISSUE TYPE
  • Bug Report
COMPONENT NAME

vmware.vmware_rest.content_library_item_info

ANSIBLE VERSION
2.16.3

COLLECTION VERSION
vmware_rest 3.0.0

CONFIGURATION
CONFIG_FILE() = None


OS / ENVIRONMENT

Linux Centos8

STEPS TO REPRODUCE

launch playbook with action vmware.vmware_rest.content_library_item_info

  - name: get content library item info for "{{ vault_vcenter_content_lib }}" / "{{ content_lib_id }}"
    vmware.vmware_rest.content_library_item_info:
      vcenter_hostname: "{{vault_vcenter_connection_args.vcenter_hostname}}"
      vcenter_username: "{{vault_vcenter_connection_args.vcenter_username}}"
      vcenter_password: "{{vault_vcenter_connection_args.vcenter_password}}"
      vcenter_validate_certs: no
      library_id: "{{ content_lib_id }}"
    register: library_item_info

EXPECTED RESULTS

No errors, and get content librray info

ACTUAL RESULTS
fatal: [localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "library_id": "9cba76a5-e31a-4002-9045-8121bd19126a",
            "library_item_id": null,
            "session_timeout": null,
            "vcenter_hostname": "output supressed",
            "vcenter_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "vcenter_rest_log_file": null,
            "vcenter_username": "output supresssed",
            "vcenter_validate_certs": false
        }
    },
    "value": {
        "error_type": "INVALID_ARGUMENT",
        "messages": [
            {
                "args": [
                    "library_id?library_id"
                ],
                "default_message": "Unsupported property with name: library_id?library_id.",
                "id": "com.vmware.vapi.rest.unsupportedProperty"
            }
        ]
    }
}


Note that exact same code worked well with previous vmware_rest collection version (2.3.1)

it seem that changing collection code in file "vmware/vmware_rest/plugins/modules/content_library_item_info.py"

line: 291

from:

     ("https://{vcenter_hostname}" "/api/content/library/item?library_id").format(

to:
("https://{vcenter_hostname}" "/api/content/library/item").format(

...solve the problem

Looks like a duplicate of #463

@Bergdolt Fell free to re-open this issue if you think I've been wrong there.