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

[PR #6227/cd706454 backport][stable-5] Fixed XenOrchestra inventory plugin failing due to not checking response ID. #6244

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Mar 26, 2023

This is a backport of PR #6227 as merged into main (cd70645).

SUMMARY

I ran into an issue where about 1/3 of the time, when using the XenOrchestra inventory plugin, the process would fail due to the first response from the XO server received being unrelated to the request. This can be easily fixed by checking that the response ID is the same as the request ID, which is what this change does.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

xen_orchestra inventory

ADDITIONAL INFORMATION

The messages from the server that cause the issue vary, but one that I noticed frequently is shown below:

{
  "jsonrpc": "2.0",
  "method": "all",
  "params": {
    "type": "exit",
    "items": {
      "eb859a79-1725-eecd-67e6-b9bf941205e4": 0
    }
  }
}

Before change:

[ansible@ansible-machine ~]$ ansible-inventory -i /etc/ansible/xen_orchestra.yml --graph
[WARNING]:  * Failed to parse /etc/ansible/xen_orchestra.yml with ansible_collections.community.general.plugins.inventory.xen_orchestra plugin: 'result'
[WARNING]: Unable to parse /etc/ansible/xen_orchestra.yml as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
@all:
  |--@ungrouped:

After change:

[ansible@ansible-machine ~]$ ansible-inventory -i /etc/ansible/xen_orchestra.yml --graph                                                                   @all:
  |--@halted:                                                                                                                                                              
  |  |--027c4638-0ad1-aab3-bc38-0c34a0009058                                                                                                                            
  |  |--02ddbd9b-af42-bab1-6811-e1e22ba719bf                                                                                                                             
  |  |--058c4616-ee04-b310-7aa8-95fb0aedab08
...

…nse ID. (#6227)

* Added call method to select proper response from xo server

* Added changelog fragment

* Removed excess blank lines

* Moved period in changelog fragment

* Made suggested changes

* Remove f-strings for Python 2.7 compatibility

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Linus Kirkwood <lkirkwood@allette.com.au>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit cd70645)
@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added backport bug This issue/PR relates to a bug inventory inventory plugin needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR new_contributor Help guide this first time contributor plugins plugin (any type) and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Mar 26, 2023
@felixfontein felixfontein merged commit 3e69748 into stable-5 Mar 26, 2023
@felixfontein felixfontein deleted the patchback/backports/stable-5/cd706454eca6bcae5e495fa27b041f350ffda21e/pr-6227 branch March 26, 2023 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug inventory inventory plugin new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants