ansible / ansible-modules-extras

Ansible extra modules - these modules ship with ansible
948 stars 1.46k forks source link

ovirt_clusters fails with 'NoneType' object has no attribute 'policy' #3685

Closed jniederm closed 7 years ago

jniederm commented 7 years ago
ISSUE TYPE
COMPONENT NAME

cloud/ovirt/ovirt_clusters.py

ANSIBLE VERSION
2.2.0.0
CONFIGURATION
OS / ENVIRONMENT
SUMMARY

Following snippet of playbook

  - name: Set CPU type for cluster
    ovirt_clusters:
     name: Default
     cpu_type: Intel Haswell-noTSX Family
     auth: "{{ auth }}" 

produces error

TASK [Set CPU type for cluster] ************************************************
task path: /home/jakub/src/ovirt-aux-scripts/automation/configure-engine.yml:18
Using module file /home/jakub/ansible-library/ovirt_clusters.py
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: jakub
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1481140926.15-251862178298182 `" && echo ansible-tmp-1481140926.15-251862178298182="` echo $HOME/.ansible/tmp/ansible-tmp-1481140926.15-251862178298182 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmp4znDH6 TO /home/jakub/.ansible/tmp/ansible-tmp-1481140926.15-251862178298182/ovirt_clusters.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/jakub/.ansible/tmp/ansible-tmp-1481140926.15-251862178298182/ /home/jakub/.ansible/tmp/ansible-tmp-1481140926.15-251862178298182/ovirt_clusters.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python2 /home/jakub/.ansible/tmp/ansible-tmp-1481140926.15-251862178298182/ovirt_clusters.py; rm -rf "/home/jakub/.ansible/tmp/ansible-tmp-1481140926.15-251862178298182/" > /dev/null 2>&1 && sleep 0'
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_dWQ5AL/ansible_module_ovirt_clusters.py", line 552, in main
    ret = clusters_module.create()
  File "/tmp/ansible_dWQ5AL/ansible_modlib.zip/ansible/module_utils/ovirt.py", line 392, in create
    if not self.update_check(entity):
  File "/tmp/ansible_dWQ5AL/ansible_module_ovirt_clusters.py", line 473, in update_check
    equal(self.param('serial_policy'), str(entity.serial_number.policy)) and
AttributeError: 'NoneType' object has no attribute 'policy'

fatal: [localhost]: FAILED! => {
    "changed": false, 
    "failed": true, 
    "invocation": {
        "module_args": {
            "ballooning": null, 
            "comment": null, 
            "compatibility_version": null, 
            "cpu_arch": null, 
            "cpu_type": "Intel Haswell-noTSX Family", 
            "datacenter": null, 
            "description": null, 
            "fence_connectivity_threshold": null, 
            "fence_enabled": null, 
            "fence_skip_if_connectivity_broken": null, 
            "fence_skip_if_sd_active": null, 
            "gluster": null, 
            "ha_reservation": null, 
            "host_reason": null, 
            "ksm": null, 
            "ksm_numa": null, 
            "memory_policy": null, 
            "migration_auto_converge": null, 
            "migration_bandwidth": null, 
            "migration_bandwidth_limit": null, 
            "migration_compressed": null, 
            "migration_policy": null, 
            "name": "Default", 
            "network": null, 
            "poll_interval": 3, 
            "resilience_policy": null, 
            "rng_sources": null, 
            "scheduling_policy": null, 
            "serial_policy": null, 
            "serial_policy_value": null, 
            "spice_proxy": null, 
            "state": "present", 
            "switch_type": null, 
            "threads_as_cores": null, 
            "timeout": 180, 
            "trusted_service": null, 
            "virt": null, 
            "vm_reason": null, 
            "wait": true
        }, 
        "module_name": "ovirt_clusters"
    }, 
    "msg": "'NoneType' object has no attribute 'policy'"
}
jniederm commented 7 years ago

Version of ovirt_clusters.py: https://github.com/ansible/ansible/blob/87d26c4729686dcffdcfa742d0cd50821296905d/lib/ansible/modules/cloud/ovirt/ovirt_clusters.py

ansibot commented 7 years ago

This repository has been locked. All new issues and pull requests should be filed in https://github.com/ansible/ansible

Please read through the repomerge page in the dev guide.