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

Use different headers for each HTTP method #55193

Merged
merged 1 commit into from
Apr 15, 2019
Merged

Use different headers for each HTTP method #55193

merged 1 commit into from
Apr 15, 2019

Conversation

jose-delarosa
Copy link
Contributor

SUMMARY

Add headers that are recommended (and in some cases necessary) to GET, POST, PATCH and DELETE methods.

For prior discussion, see #55062.

Fixes #55078

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

redfish_utils

ADDITIONAL INFORMATION

Before patch:

TASK [Get CPU Inventory] *******************************************************
Tuesday 09 April 2019  17:13:44 -0500 (0:00:00.438)       0:00:00.620 *********
fatal: [red4]: FAILED! => {"changed": false, "msg": "HTTP Error 406 on GET request to 'https://idrac-7ffg0m2/redfish/v1/', extended message: 'Not Acceptable'"}

After patch:

TASK [Get CPU Inventory] *******************************************************
Tuesday 09 April 2019  17:14:49 -0500 (0:00:00.483)       0:00:00.654 *********
ok: [red4]

@ansibot
Copy link
Contributor

ansibot commented Apr 12, 2019

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. community_review In order to be merged, this PR must follow the community review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. owner_pr This PR is made by the module's maintainer. remote_management Working Group: https://docs.ansible.com/ansible/latest/community/communication.html support:community This issue/PR relates to code supported by the Ansible community. labels Apr 12, 2019
@mariolenz
Copy link
Contributor

Today, I tested our playbooks with the additional Accept: application/json and OData-Version: 4.0 headers without any problems. Worked with some older HP servers (ProLiant DL380 Gen 8 and 9), too... but we don't do much with them, only gathering some facts.

Btw: Good idea to get rid of the unnecessary hdrs parameter in post_request, patch_request and delete_request.

Copy link
Contributor

@billdodd billdodd left a comment

Choose a reason for hiding this comment

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

Reviewed and tested. Looks good.

shipit

@ansibot ansibot added shipit This PR is ready to be merged by Core and removed community_review In order to be merged, this PR must follow the community review workflow. needs_triage Needs a first human triage before being processed. labels Apr 12, 2019
@jose-delarosa
Copy link
Contributor Author

shipit

@gundalow gundalow merged commit f88b2cb into ansible:devel Apr 15, 2019
@gundalow
Copy link
Contributor

Merged into devel (which will become Ansible 2.9)
If you'd like this fix in Ansible 2.8, please raise a backport PR for the stable-2.8 branch by following https://docs.ansible.com/ansible/devel/community/development_process.html#making-your-pr-merge-worthy

@jose-delarosa @mariolenz @billdodd Thank you!

mariolenz pushed a commit to mariolenz/ansible that referenced this pull request Apr 15, 2019
mariolenz added a commit to mariolenz/ansible that referenced this pull request Apr 15, 2019
abadger pushed a commit that referenced this pull request Apr 16, 2019
abadger pushed a commit that referenced this pull request Apr 17, 2019
* Use different headers for each HTTP method (#55193)

(cherry picked from commit f88b2cb)

* add changelog fragment
@ansible ansible locked and limited conversation to collaborators Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. module This issue/PR relates to a module. owner_pr This PR is made by the module's maintainer. remote_management Working Group: https://docs.ansible.com/ansible/latest/community/communication.html shipit This PR is ready to be merged by Core support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redfish modules don't work with iDRAC 3.30.30.30
5 participants