Bug 823577 - [ovirt] Delete action on storage domain sends string representation of Python object
[ovirt] Delete action on storage domain sends string representation of Python...
Status: CLOSED WORKSFORME
Product: oVirt
Classification: Community
Component: ovirt-engine-sdk (Show other bugs)
unspecified
x86_64 Linux
unspecified Severity urgent
: ---
: ---
Assigned To: Michael Pasternak
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-21 10:57 EDT by Jakub Libosvar
Modified: 2014-01-12 19:37 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-05-21 11:20:49 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jakub Libosvar 2012-05-21 10:57:23 EDT
Description of problem:
When one wants to detach storage domain from DC, the sent link for DELETE action is /api/datacenters/9190febf-4bfd-4a9a-9b95-c882d0573289/storagedomains/ab9aed7b-f011-4d6d-a0a4-52e2ba7b4e8d;async=%3Covirtsdk.xml.params.StorageDomain+object+at+0x23b3990%3E 
instead of just /api/datacenters/9190febf-4bfd-4a9a-9b95-c882d0573289/storagedomains/ab9aed7b-f011-4d6d-a0a4-52e2ba7b4e8d

Version-Release number of selected component (if applicable):
built from commit f948815152deb48bc8eb7b9f92d056d69b491995

How reproducible:
Always

Steps to Reproduce:
1. Have a storage domain in Inactive state in DC
2. use sd.delete() on given storage domain object
  
Actual results:
/api/datacenters/9190febf-4bfd-4a9a-9b95-c882d0573289/storagedomains/ab9aed7b-f011-4d6d-a0a4-52e2ba7b4e8d;async=%3Covirtsdk.xml.params.StorageDomain+object+at+0x23b3990%3E

Expected results:
/api/datacenters/9190febf-4bfd-4a9a-9b95-c882d0573289/storagedomains/ab9aed7b-f011-4d6d-a0a4-52e2ba7b4e8d

Additional info:
I tested just sending DELETE with string in expected results and it works.
Comment 1 Michael Pasternak 2012-05-21 11:05:19 EDT
the signature is: def delete(self, async=None):,

can you please attach your python code
Comment 2 Michael Pasternak 2012-05-21 11:06:45 EDT
and sdk debug log
Comment 3 Michael Pasternak 2012-05-21 11:20:49 EDT
i believe the problem is in your code, you did sd.delete(sd) or similar

i just did the following:

dc = api.datacenters.get(name='Default_nfs')
sd = dc.storagedomains.get(name='nfs_export')
sd.delete()

what is produce right http code:

send: 'GET /api/datacenters?search=name%3DDefault_nfs HTTP/1.1\r\nHost: localhost:8080\r\nAccept-Encoding: identity\r\nPrefer: persistent-auth\r\nContent-type: application/xml\r\nAuthorization: Basic ... \r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Server: Apache-Coyote/1.1
header: Set-Cookie: JSESSIONID=...; Path=/api
header: Content-Type: application/xml
header: Content-Length: 904
header: Date: Mon, 21 May 2012 15:17:20 GMT
send: 'GET /api/datacenters/bfe850fc-14d0-4a06-a765-520a2b9e59e4/storagedomains HTTP/1.1\r\nHost: localhost:8080\r\nAccept-Encoding: identity\r\nPrefer: persistent-auth\r\nContent-type: application/xml\r\nAuthorization: Basic ...\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Server: Apache-Coyote/1.1
header: Set-Cookie: JSESSIONID=....; Path=/api
header: Content-Type: application/xml
header: Content-Length: 3655
header: Date: Mon, 21 May 2012 15:17:22 GMT
send: 'DELETE /api/datacenters/bfe850fc-14d0-4a06-a765-520a2b9e59e4/storagedomains/47dd3e38-c252-4586-b180-afc8e8011df1 HTTP/1.1\r\nHost: localhost:8080\r\nAccept-Encoding: identity\r\nPrefer: persistent-auth\r\nAuthorization: Basic ...\r\n\r\n'
reply: 'HTTP/1.1 400 Bad Request\r\n'
header: Server: Apache-Coyote/1.1
header: Content-Type: application/xml
header: Content-Length: 251
header: Date: Mon, 21 May 2012 15:17:27 GMT
header: Connection: close

the problem in this delete that sdk sends Content-Type header but this 
is different bug.
Comment 4 Jakub Libosvar 2012-05-21 11:31:27 EDT
weird - now it works for me too and I have changed nothing...
Comment 5 Michael Pasternak 2012-05-21 11:57:21 EDT
(In reply to comment #4)
> weird - now it works for me too and I have changed nothing...

the code is simple, to uri appended /async/ param content, if you put
obj in it, it will be obj.__str__

Note You need to log in before you can comment on or make changes to this bug.