Bug 1193848

Summary: [REGENERATE PYTHON SDK] Element ovirtsdk.infrastructure.brokers.StorageDomain object has no attribute 'is_attached'
Product: Red Hat Enterprise Virtualization Manager Reporter: David Caro <dcaroest>
Component: ovirt-engine-sdk-pythonAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Pavel Stehlik <pstehlik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.5.0CC: amureini, eedri, gklein, juan.hernandez, khakimi, lpeer, lsurette, mlipchuk, ncredi, rbalakri, Rhev-m-bugs, srevivo, ykaul, ylavi
Target Milestone: ovirt-3.6.0-rc3Keywords: Automation
Target Release: 3.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-sdk-python-3.6.0.0-0.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-20 01:32:51 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 David Caro 2015-02-18 12:13:39 UTC
Description of problem:
Failing to add a storage when running the tests

Version-Release number of selected component (if applicable):
3.5.0

How reproducible:
Run the storage tests

Steps to Reproduce:
1.Run the tests
2.
3.

Actual results:
Tests failed with the error in $Summary

Expected results:
Tests pass

Additional info:
The job that is failing is:

http://jenkins-ci.eng.lab.tlv.redhat.com/job/rhevm_3.5_el6-engine_el6-host_automation_infra_one_host_restapi_mixed_nfs_sdk_factory/458

It creates the storage but then it fails with the missing attribute error:

2015-02-18 12:29:37,542 - MainThread - storagedomains - DEBUG - CREATE api content is --  collection:storagedomains element:<storage_domain>
    <name>DataDomainRest</name>
    <type>data</type>
    <storage>
        <address>10.35.148.15</address>
        <type>nfs</type>
        <path>/vol/vfilers/nfs01/jenkins-automation-rpm-vm48_nfs_2015_02_18_12_20_30_208008</path>
    </storage>
    <host>
        <name>loki01.ci.lab.tlv.redhat.com</name>
    </host>
    <storage_format>v3</storage_format>
</storage_domain>
 
2015-02-18 12:29:39,507 - MainThread - core_api - DEBUG - Request POST response time: 0.150
2015-02-18 12:29:40,228 - MainThread - storagedomains - INFO - New entity was added successfully
2015-02-18 12:29:40,229 - MainThread - storagedomains - ERROR - Element '<ovirtsdk.infrastructure.brokers.StorageDomain object at 0x3c927d0>' has no attribute 'is_attached'

Comment 1 Allon Mureinik 2015-02-21 20:30:58 UTC
Maor, this sounds familiar from one of your recent patches.
Please take a look?

Comment 2 Maor 2015-02-22 13:42:11 UTC
(In reply to Allon Mureinik from comment #1)
> Maor, this sounds familiar from one of your recent patches.
> Please take a look?

The issue which you refer to is the importxx field,
this is a different field (is_attached), which is also, not mandatory, and was only added recently.

Just to be on the safe side, I've tried to add a new Storage Domain through REST and it worked. This is the request which I used which succeed:

<storage_domain>
    <name>DataDomainRest</name>
    <type>data</type>
    <storage>
        <address>10.35.16.2</address>
        <type>nfs</type>
        <path>/export/images/rnd/maor/data3</path>
    </storage>
    <host>
        <name>pluto-vdsb.eng.lab.tlv.redhat.com</name>
    </host>
    <storage_format>v3</storage_format>
</storage_domain>

<storage_domain>
    <name>DataDomainRest</name>
    <type>data</type>
    <storage>
        <address>10.35.16.2</address>
        <type>nfs</type>
        <path>/export/images/rnd/maor/data3</path>
    </storage>
    <host>
        <name>pluto-vdsb.eng.lab.tlv.redhat.com</name>
    </host>
    <storage_format>v3</storage_format>
</storage_domain>

Comment 3 Maor 2015-02-22 13:44:19 UTC
It looks like the SDK version was not compatible with the engine version,
Juan, could it be that this is the origin of the problem?

Comment 4 Juan Hernández 2015-02-23 09:29:35 UTC
In order to support the "is_attached" property the SDKs need to be regenerated.

Comment 5 Juan Hernández 2015-03-03 08:53:59 UTC
This issue has been fixed in upstream version 3.6.0.0preview9 and will be available downstream with the first 3.6 build.

Comment 6 Kobi Hakimi 2015-03-12 10:18:59 UTC
[Ovirt SDK] in StorageDomain object missing "is_attached" and "import" fields thus our regression mix failed in build vt14:
 http://jenkins.qa.lab.tlv.redhat.com:8080/job/3.5-regression_mixed/84/consoleFull
looking for:
23:41:57 2015-03-09 23:41:57,431 - MainThread - storagedomains - ERROR - Element '<ovirtsdk.infrastructure.brokers.StorageDomain object at 0x31ed490>' has no attribute 'is_attached'
23:41:57 2015-03-09 23:41:57,435 - MainThread - storagedomains - ERROR - Element '<ovirtsdk.infrastructure.brokers.StorageDomain object at 0x31ed490>' has no attribute 'import'

Comment 7 Juan Hernández 2015-03-12 11:21:29 UTC
Note that these missing attributes will be available when the SDKs are rebased using upstream version 3.5.2, and in order to do that the following bugs need to be approved:

  Rebase Python SDK to upstream 3.5.2
  https://bugzilla.redhat.com/1196980

  Rebase Java SDK to upstream 3.5.2
  https://bugzilla.redhat.com/1196981

Comment 9 Eyal Edri 2015-11-01 14:26:12 UTC
this bug has both 3.5.z & 3.6.0 flags, in bugzilla lang it means its a clone candidate from 3.6.0 to 3.5.z meaning it's pending a clone and wasn't fixed for 3.5.z.

if this isn't the case, please fix flags accordingly,
if it is the case, then please clone the bugs to 3.5.7 (3.5.6 was built already)

Comment 10 Juan Hernández 2015-11-02 08:59:53 UTC
This fix was included in release 3.5.2.1. I can't remove the rhevm-3.5.z flag. Allon, can you?

Comment 11 Yaniv Lavi 2015-11-02 11:16:15 UTC
(In reply to Juan Hernández from comment #10)
> This fix was included in release 3.5.2.1. I can't remove the rhevm-3.5.z
> flag. Allon, can you?

Shouldn't this be closed current release then?

Comment 12 Juan Hernández 2015-11-02 11:19:56 UTC
No, this is a 3.6 bug. The bug that fixed the issue in 3.5 is bug 1196980, that is CLOSED ERRATA.

Comment 13 Yaniv Lavi 2015-11-02 11:22:38 UTC
(In reply to Juan Hernández from comment #12)
> No, this is a 3.6 bug. The bug that fixed the issue in 3.5 is bug 1196980,
> that is CLOSED ERRATA.

The doc text and ref bug, do not include anything like this one. Can you point me to the bug tracking this fix for 3.5 oVirt\RHEV?

Comment 14 Juan Hernández 2015-11-02 11:37:00 UTC
The bug tracking this fix for 3.5 is bug 1196980.

The Python SDK (and the Java SDK) is automatically generated from the metadata provided by the engine. We don't explicitly track each single change that re-generation introduces, instead we use generic bugs, like bug 1196980.