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

content_library_item_info fails when you only specify library_id #540

Open
1 task done
mikemorency opened this issue Oct 10, 2024 · 1 comment
Open
1 task done
Assignees
Labels
bug This issue/PR relates to a bug

Comments

@mikemorency
Copy link
Collaborator

mikemorency commented Oct 10, 2024

Summary

The content_library_item_info module fails when a user specifies just the library_id. This triggers the 'list' method, which has an incorrect API url. Heres the relevant lines: https://github.com/ansible-collections/vmware.vmware_rest/blob/main/plugins/modules/content_library_item_info.py#L292-L298

As far as I can tell, the module generation is working as expected. Heres the VMware source docs:
https://developer.broadcom.com/xapis/vsphere-automation-api/latest/content/api/content/library/item__library_id/get/

It currently is:

    return yarl.URL(
        ("https://{vcenter_hostname}" "/api/content/library/item?library_id").format(
            **params
        )
        + gen_args(params, _in_query_parameters),
        encoded=True,
    )

It should be:

    return yarl.URL(
        ("https://{vcenter_hostname}" "/api/content/library/item").format(
            **params
        )
        + gen_args(params, _in_query_parameters),
        encoded=True,
    )

Obviously the quick fix is a simple change. However, since the module will just be re-generated with the incorrect URL I'd like to discuss how best to fix this long term.

We could migrate the module functionality to vmware.vmware, but whats the best way to communicate this to users in this collection? Would we be able to deprecate this module with a minor release, and then remove it with a major release down the line? Is that the best course of action?

Issue Type

Feature Idea

Component Name

content_library_item_info

Additional Information

---
- name: Test Playbook
  hosts: localhost
  gather_facts: false
  tasks:
    - name: Foo
      vmware.vmware_rest.content_library_item_info:
        vcenter_validate_certs: false
        library_id: "{{ my_library_id }}"
      register: ds_lib_items_info
    - debug:
        var: ds_lib_items_info

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@mikemorency
Copy link
Collaborator Author

@mariolenz @bardielle Id like your opinions on this please

@mikemorency mikemorency added bug This issue/PR relates to a bug and removed needs_triage labels Oct 10, 2024
@mikemorency mikemorency self-assigned this Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug
Projects
None yet
Development

No branches or pull requests

1 participant