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

Make xenserver_facts actually work #35821

Merged
merged 1 commit into from
May 22, 2018
Merged

Make xenserver_facts actually work #35821

merged 1 commit into from
May 22, 2018

Conversation

cheese
Copy link
Contributor

@cheese cheese commented Feb 7, 2018

SUMMARY

Make xenserver_facts actually work.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

xenserver_facts

ANSIBLE VERSION
ansible 2.4.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/cheese/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.14 (default, Dec 11 2017, 16:08:01) [GCC 7.2.1 20170915 (Red Hat 7.2.1-2)]
ADDITIONAL INFORMATION

Tested with XenServer 7.1.

before:

$ ansible -m xenserver_facts -i hosts autohosts
192.168.209.75 | FAILED! => {
    "changed": false, 
    "module_stderr": "Shared connection to 192.168.209.75 closed.\r\n", 
    "module_stdout": "Traceback (most recent call last):\r\n  File \"/tmp/ansible_zG0vtS/ansible_module_xenserver_facts.py\", line 208, in <module>\r\n    main()\r\n  File \"/tmp/ansible_zG0vtS/ansible_module_xenserver_facts.py\", line 188, in main\r\n    xs_vms = get_vms(session)\r\n  File \"/tmp/ansible_zG0vtS/ansible_module_xenserver_facts.py\", line 152, in get_vms\r\n    vms = change_keys(recs, key='uuid')\r\n  File \"/tmp/ansible_zG0vtS/ansible_module_xenserver_facts.py\", line 131, in change_keys\r\n    for ref, rec in recs.items():\r\nAttributeError: 'list' object has no attribute 'items'\r\n", 
    "msg": "MODULE FAILURE", 
    "rc": 0
}

after:
(working as expected, output too large.)

@ansibot ansibot added bugfix_pull_request cloud core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. needs_maintainer Ansibot is unable to identify maintainers for this PR. (Check `author` in docs or BOTMETA.yml) needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Feb 7, 2018
@samdoran samdoran removed the needs_triage Needs a first human triage before being processed. label Feb 8, 2018
@samdoran samdoran self-assigned this Feb 8, 2018
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Feb 16, 2018
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bugfix_pull_request labels Mar 2, 2018
@finite-state-machine
Copy link

I can confirm that xenserver_facts is broken on XenServer 7.4, but works with this patch.

@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Apr 18, 2018
@ansibot ansibot added the affects_2.6 This issue/PR affects Ansible v2.6 label May 20, 2018
@ansibot
Copy link
Contributor

ansibot commented May 22, 2018

The test ansible-test sanity --test yamllint [explain] failed with 1 error:

.github/BOTMETA.yml:270:12: error syntax error: mapping values are not allowed here

click here for bot help

@ansibot ansibot added ci_verified Changes made in this PR are causing tests to fail. and removed needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels May 22, 2018
* Get the str value of xmlrpc.client.DateTime

* get_all_records should be used instead of get_all

* Facts returned with 'ansible_facts'

* Remove some redundant code

* Add cheese as maintainer

* Add changelog entry
@samdoran samdoran merged commit d45b044 into ansible:devel May 22, 2018
samdoran pushed a commit to samdoran/ansible that referenced this pull request May 22, 2018
* Get the str value of xmlrpc.client.DateTime

* get_all_records should be used instead of get_all

* Facts returned with 'ansible_facts'

* Remove some redundant code

* Add cheese as maintainer

* Add changelog entry

(cherry picked from commit d45b044)
samdoran added a commit that referenced this pull request May 22, 2018
* Get the str value of xmlrpc.client.DateTime

* get_all_records should be used instead of get_all

* Facts returned with 'ansible_facts'

* Remove some redundant code

* Add cheese as maintainer

* Add changelog entry

(cherry picked from commit d45b044)
achinthagunasekara pushed a commit to achinthagunasekara/ansible that referenced this pull request May 23, 2018
* Get the str value of xmlrpc.client.DateTime

* get_all_records should be used instead of get_all

* Facts returned with 'ansible_facts'

* Remove some redundant code

* Add cheese as maintainer

* Add changelog entry
jacum pushed a commit to jacum/ansible that referenced this pull request Jun 26, 2018
* Get the str value of xmlrpc.client.DateTime

* get_all_records should be used instead of get_all

* Facts returned with 'ansible_facts'

* Remove some redundant code

* Add cheese as maintainer

* Add changelog entry
ilicmilan pushed a commit to ilicmilan/ansible that referenced this pull request Nov 7, 2018
* Get the str value of xmlrpc.client.DateTime

* get_all_records should be used instead of get_all

* Facts returned with 'ansible_facts'

* Remove some redundant code

* Add cheese as maintainer

* Add changelog entry
@ansible ansible locked and limited conversation to collaborators May 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. ci_verified Changes made in this PR are causing tests to fail. cloud module This issue/PR relates to a module. needs_maintainer Ansibot is unable to identify maintainers for this PR. (Check `author` in docs or BOTMETA.yml) needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. new_contributor This PR is the first contribution by a new community member. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants