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

theforeman.foreman.resource_info Unknown action 'index'. Supported actions: disable, eligible, enable, status #1711

Open
IncredibleRichie opened this issue Feb 22, 2024 · 3 comments

Comments

@IncredibleRichie
Copy link
Contributor

SUMMARY

theforeman.foreman.resource_info seems to use index were no index is allowed

ISSUE TYPE
  • Bug Report
ANSIBLE VERSION
ansible [core 2.15.3]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.11/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.11.5 (main, Oct 25 2023, 16:19:59) [GCC 8.5.0 20210514 (Red Hat 8.5.0-20)] (/usr/bin/python3.11)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
theforeman.foreman            4.0.0  

KATELLO/FOREMAN VERSION

foreman-3.9
STEPS TO REPRODUCE
- name: "Read all SCA with full details"
  theforeman.foreman.resource_info:
    <<: *auth_params
    resource: simple_content_access
    full_details: true
  register: result
- debug:
    var: result.resources
EXPECTED RESULTS

Info about the organizations SCA setting

ACTUAL RESULTS
TASK [or_smart_proxy_content : Read all SCA with full details] *********************************************
Thursday 22 February 2024  12:43:30 +0100 (0:00:00.075)       0:00:05.057 ***** 
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to list resource: KeyError: \"Unknown action 'index'. Supported actions: disable, eligible, enable, status\""}

@evgeni
Copy link
Member

evgeni commented Feb 23, 2024

It's more that simple_content_access is not really a "resource", so it can't be indexed, or shown.

@IncredibleRichie
Copy link
Contributor Author

Thanks.

If you run the module with an unsupported "resource" all supported "resources" are listed incl. simple_content_access, this lets me assume i can use it.
It should then perhaps not be listed.

@evgeni
Copy link
Member

evgeni commented Feb 23, 2024

I'd take a patch that filters those out that do not have an index action ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants