-
Notifications
You must be signed in to change notification settings - Fork 56
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] host module fails because REST API puts trailing slash now #41
Comments
@elwood218 thanks for reporting this issue. |
@robin-tribe29 Done.... |
@elwood218 Thanks for the update! |
Working:
NOT Working: (DIFFERENCE IS THE TRAILING SLASH)
|
PS: The host must be already there - I guess only then you can see it @robin-tribe29 |
Now I can reproduce the issue, thanks! @lgetwan can you take a look please? fatal: [test1.tld -> localhost]: FAILED! => {"changed": false, "msg": "Error calling API. HTTP code 400. Details: b'{\"title\": \"Bad Request\", \"status\": 400, \"detail\": \"These fields have problems: target_folder\", \"fields\": {\"target_folder\": [\"\\'\\\\/test\\\\/\\' does not match pattern \\'(?:(?:[~\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/]|(?:[~\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/][-_ a-zA-Z0-9.]+)+)|[0-9a-fA-F]{32})\\'.\"]}}', "} |
I got an different error:
|
@robin-tribe29 I just found out that if the host is added first time the "create host" function (not the correct name of the function, just to name it) does NOT want the trailing slash. |
Thanks for your continuing feedback! |
That's very pity..... I know that the module is not supported officially but at the moment that is the only way. Furthermore the module is only not working anymore because of your changes to the API - before it was working fine. It also doesn't make sense that in the same module the function for creating needs a trailing slash and the function for moving doesn't want a trailing slash - this makes the whole module unusable. |
I understand your frustration, I really do. |
@robin-tribe29 Could you please add this as workaround to the host module?
There is only one line added |
Hi @elwood218,
That way, it will be a workaround for the "trailing slash problem" and still work with CMK 2.0.0. Please check if that works for you. |
@lgetwan I have tested it with your devel branch and Checkmk 2.1.0 stable and it seems to work now. Really thank you! :) |
Since 2.1.0p4, the trailing slash bug was fixed. |
Well but now it isn't working anymore with the Ansible module... |
Please verify first that your feedback is not already reported here.
If possible and useful provide additional information below. This is optional however.
Provide your feedback
Beginning with Checkmk
2.1.0b6
the output of gettingcurrent_folder
from REST API has changed. Now a trailing slash is added. So like in my case if the parameterfolder
had no trailing slash the conditionif current_folder != module.params["folder"]:
was failing after2.1.0b5
.I added now a trailing slash and this could also be checked in the role I build but if I am correct then modules like "sychronize" and more also checking that.
Component Name
host
Ansible Version
Collection Version
Environment
Checkmk Version: 2.1.0b5 (WORKING - but maybe that would fail if folder parameter got an trailing slash)
Checkmk Version: 2.1.0b6, 2.1.0b7, 2.1.0b8 (FAILING - fixed by putting a trailing slash into folder variable)
Screenshots
Additional context
The text was updated successfully, but these errors were encountered: