Bug 823577 - [ovirt] Delete action on storage domain sends string representation of Python object
Summary: [ovirt] Delete action on storage domain sends string representation of Python...
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-sdk
Version: unspecified
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ---
: ---
Assignee: Michael Pasternak
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-21 14:57 UTC by Jakub Libosvar
Modified: 2014-01-13 00:37 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-21 15:20:49 UTC
oVirt Team: ---
Embargoed:


Attachments (Terms of Use)

Description Jakub Libosvar 2012-05-21 14:57:23 UTC
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 15:05:19 UTC
the signature is: def delete(self, async=None):,

can you please attach your python code

Comment 2 Michael Pasternak 2012-05-21 15:06:45 UTC
and sdk debug log

Comment 3 Michael Pasternak 2012-05-21 15:20:49 UTC
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 15:31:27 UTC
weird - now it works for me too and I have changed nothing...

Comment 5 Michael Pasternak 2012-05-21 15:57:21 UTC
(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.