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
base: develop
Are you sure you want to change the base?
Conversation
curl could fail to make the POST request and the registration would still appear as successful.
Can one of the admins verify this patch? |
2 similar comments
Can one of the admins verify this patch? |
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 %> \ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
curl could fail to make the POST request and the registration would still appear as successful.