Liron Ar has posted comments on this change.

Change subject: BindingXmlRPC - do_PUT to return created task id in header
......................................................................


Patch Set 5:

(3 comments)

http://gerrit.ovirt.org/#/c/27997/5/vdsm/BindingXMLRPC.py
File vdsm/BindingXMLRPC.py:

Line 118:             HEADER_IMAGE = 'Image-Id'
Line 119:             HEADER_VOLUME = 'Volume-Id'
Line 120:             HEADER_TASK_ID = 'Task-Id'
Line 121:             HEADER_CODE = 'Status-Code'
Line 122:             HEADER_MESSAGE = 'Status-Message'
> These are use for GET.
they aren't,  if they were they should have been in the do_GET patch :)
Line 123:             HEADER_CONTENT_LENGTH = 'content-length'
Line 124:             HEADER_CONTENT_TYPE = 'content-type'
Line 125: 
Line 126:             def setup(self):


Line 118:             HEADER_IMAGE = 'Image-Id'
Line 119:             HEADER_VOLUME = 'Volume-Id'
Line 120:             HEADER_TASK_ID = 'Task-Id'
Line 121:             HEADER_CODE = 'Status-Code'
Line 122:             HEADER_MESSAGE = 'Status-Message'
> These shouldn't be here anymore.
Done
Line 123:             HEADER_CONTENT_LENGTH = 'content-length'
Line 124:             HEADER_CONTENT_TYPE = 'content-type'
Line 125: 
Line 126:             def setup(self):


Line 178:                         self.send_header(self.HEADER_TASK_ID, 
response['uuid'])
Line 179:                         self.end_headers()
Line 180:                     else:
Line 181:                         
self.send_response(httplib.INTERNAL_SERVER_ERROR)
Line 182:                         json_response = json.dumps(response)
> Once as Task-Id and once as uuid?!
No, the json response is returned in the body only in case of an error in task 
creation to provide more info to the user (no task created).

when a task is created it's id is returned within the header so that we'll be 
able to return it in do_GET as well (as body will contain the data).

see also the commit message of this patch
Line 183:                         self.send_header(self.HEADER_CONTENT_TYPE,
Line 184:                                          'application/json')
Line 185:                         self.send_header(self.HEADER_CONTENT_LENGTH,
Line 186:                                          len(json_response))


-- 
To view, visit http://gerrit.ovirt.org/27997
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I25b13f44a65cb2c794c458b03ba361bf0af92120
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Liron Ar <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Liron Ar <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to