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

Fixes #37292 - Deal with curl error codes when registering hosts #10109

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

pablomh
Copy link

@pablomh pablomh commented Mar 22, 2024

curl could fail to make the POST request and the registration would still appear as successful.

@theforeman-bot
Copy link
Member

Can one of the admins verify this patch?

2 similar comments
@theforeman-bot
Copy link
Member

Can one of the admins verify this patch?

@theforeman-bot
Copy link
Member

Can one of the admins verify this patch?

@@ -106,7 +106,8 @@ fi
<% end -%>

register_host() {
curl --silent --show-error --cacert $SSL_CA_CERT --request POST <%= @registration_url %> \
CURL_OUT=$(mktemp)
HTTP_RETURN_CODE=$(curl --silent --output $CURL_OUT --write-out "%{http_code}" --cacert $SSL_CA_CERT --request POST <%= @registration_url %> \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not to use --fail? It's available on EL7. Perhaps not on EL6?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't try it because: Fail silently (no output at all) and I wanted to show the error output.

@nofaralfasi nofaralfasi self-requested a review March 24, 2024 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants