Nir Soffer has posted comments on this change.

Change subject: core: GET requests - use Range header
......................................................................


Patch Set 8: Code-Review-1

(1 comment)

http://gerrit.ovirt.org/#/c/28465/8/vdsm/BindingXMLRPC.py
File vdsm/BindingXMLRPC.py:

Line 284:                     raise self.RequestException(
Line 285:                         httplib.BAD_REQUEST,
Line 286:                         "unspecified range last byte position isn't 
supported")
Line 287: 
Line 288:                 return self._getInt(last_byte) + 1
So now the only issue here is too trying to raise too many different errors - 
as I commented in the previous patch, we don't need and want this kind of code. 
We need one error here when this regex does not match:

    ^bytes=0-(\d+)$

Anything which does not match it is not supported, and the person trying to 
integrate with us should check the documentation on what ranges are supported.

So this should be:

    match = re.match(r'^bytes=0-(\d+)$', value)
    if not match:
        raise self.RequestException(
            httplib.BAD_REQUEST,
            "Unsupported range: %r expected: 0-last_byte" % value)
    last_byte = self._getInt(match.group(1))
    return  last_byte + 1

Anything more then that is useless code that we have to maintain. We already 
have too much code to maintain.
Line 289: 
Line 290:             def send_error(self, error, message, exc_info=False):
Line 291:                 try:
Line 292:                     self.log.error(message, exc_info=exc_info)


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8164867347b1cf800efd2a78cc98dbc10c02ee0d
Gerrit-PatchSet: 8
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Liron Aravot <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Liron Aravot <[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