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

[BUG] Folder creation fails with trailing slash #42

Closed
robin-checkmk opened this issue May 16, 2022 · 3 comments
Closed

[BUG] Folder creation fails with trailing slash #42

robin-checkmk opened this issue May 16, 2022 · 3 comments
Assignees
Labels
bug Something isn't working upstream There is something upstream blocking this

Comments

@robin-checkmk
Copy link
Member

Describe the bug

Trying to create a folder with a trailing slash lets the folder module fail.

Component Name

folder

Ansible Version

$ ansible --version
ansible [core 2.12.5]
  config file = /vagrant/ansible.cfg
  configured module search path = ['/vagrant/plugins/modules']
  ansible python module location = /usr/local/lib/python3.8/dist-packages/ansible
  ansible collection location = /home/vagrant/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0]
  jinja version = 2.10.1
  libyaml = True

Checkmk Version

2.0.0p23 (CRE)

Collection Version

$ ansible-galaxy collection list
# /home/vagrant/.ansible/collections/ansible_collections
Collection      Version
--------------- -------
tribe29.checkmk 0.2.2 

Environment

Ubuntu 20.04
Python 3.8.10

To Reproduce
Steps to reproduce the behavior:

  1. Create a folder without a trailing slash
  2. Try to create the exact same folder again, but with a trailing slash now

Expected behavior

We get an OK state from Ansible, as the folder already exists.

Actual behavior

We get an error message and the task fails:

TASK [Create folders.] **********************************************************************************
failed: [test1.tld -> localhost] (item={'path': '/test/', 'title': 'Test'}) => {"ansible_loop_var": "item", "changed": false, "item": {"path": "/test/", "title": "Test"}, "msg": "Error calling API. HTTP code 400. Details: b'{\"title\": \"Path already exists\", \"status\": 400, \"detail\": \"The path \\'\\\\/test\\' already exists.\"}', "}

Screenshots

Additional context

@robin-checkmk robin-checkmk added the bug Something isn't working label May 16, 2022
@robin-checkmk robin-checkmk added the upstream There is something upstream blocking this label Jun 24, 2022
@robin-checkmk
Copy link
Member Author

There are changes that need to be made to the Checkmk REST API, which we are waiting for.

@lgetwan
Copy link
Contributor

lgetwan commented Jun 30, 2022

This is fixed in the upcoming 2.1.0p5 (already in current 2.1.0 branch's daily build)

@robin-checkmk
Copy link
Member Author

Closing, as this has long been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream There is something upstream blocking this
Projects
None yet
Development

No branches or pull requests

2 participants