Bug 2084235

Summary: Misleading error when using the name of existing storage domain in ansible ovirt_storage_domain module
Product: [oVirt] ovirt-ansible-collection Reporter: Barbora Dolezalova <bdolezal>
Component: GeneralAssignee: Martin Necas <mnecas>
Status: CLOSED CURRENTRELEASE QA Contact: Barbora Dolezalova <bdolezal>
Severity: low Docs Contact:
Priority: low    
Version: 2.0.3CC: bugs, mperina
Target Milestone: ovirt-4.5.2Keywords: ZStream
Target Release: 2.2.0Flags: mperina: ovirt-4.5+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-ansible-collection-2.2.0-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-08 08:17:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Barbora Dolezalova 2022-05-11 17:27:46 UTC
Description of problem:
Misleading error when using the name of existing storage domain in ansible ovirt_storage_domain module. 

# Add data NFS storage domain
    - ovirt.ovirt.ovirt_storage_domain:
        name: Ble        #This name is used in the different data center
        host: host_mixed_2
        data_center: golden_env_mixed
        nfs:
          address: "{{nfs_server}}"
          path: "{{nfs_path}}"
        auth: "{{ovirt_auth}}"

TASK [ovirt.ovirt.ovirt_storage_domain] ******
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'NoneType' object has no attribute 'status'
fatal: [localhost]: FAILED! => {"changed": false, "msg": "'NoneType' object has no attribute 'status'"}

Version-Release number of selected component (if applicable):
ovirt-ansible-collection-2.0.3-1.el8ev.noarch

How reproducible:
Always

Steps to Reproduce:
1. You have to have two data centers 
2. Try to add storage domain to the second data center with the same name as already existing in the first data center
3. Weird error about "msg": "'NoneType' object has no attribute 'status'"

Comment 2 Sandro Bonazzola 2022-08-30 08:49:07 UTC
This bugzilla is included in oVirt 4.5.2 release, published on August 10th 2022.
Since the problem described in this bug report should be resolved in oVirt 4.5.2 release, it has been closed with a resolution of CURRENT RELEASE.
If the solution does not work for you, please open a new bug report.