Change in vdsm[master]: imagetickets: Support image tickets
aaviram at redhat.com
aaviram at redhat.com
Wed Jan 20 15:43:49 UTC 2016
Amit Aviram has posted comments on this change.
Change subject: imagetickets: Support image tickets
......................................................................
Patch Set 10:
(6 comments)
https://gerrit.ovirt.org/#/c/50014/10//COMMIT_MSG
Commit Message:
Line 11: oVirt's storage devices.
Line 12:
Line 13: Specifically, this VDSM module is responsible for granting permissions
Line 14: for image transfers, via a ticket mechanism for an image, sent from
Line 15: engine, through VDSM to imaged- a process for image IO which resides
> Add a space before "-"
Done
Line 16: next to VDSM in the host.
Line 17:
Line 18: Change-Id: I6b9ded4bde73b1ab504cae50d2cea726d4f77e51
https://gerrit.ovirt.org/#/c/50014/10/lib/api/vdsmapi-schema.json
File lib/api/vdsmapi-schema.json:
Line 8423: # @ops: operations list to be applied on the image
Line 8424: #
Line 8425: # @size: block size of each transferred chunk
Line 8426: #
Line 8427: # @path: an image path
> Using a URL in all cases (incl. "file://") is a nice, extensible way to spe
Done
Line 8428: #
Line 8429: # Since: 4.18.0
Line 8430: ##
Line 8431: {'type': 'ImageTicket',
https://gerrit.ovirt.org/#/c/50014/10/vdsm/API.py
File vdsm/API.py:
Line 1623: return errCode['haErr']
Line 1624: return {'status': doneCode}
Line 1625:
Line 1626: def add_image_ticket(self, ticket):
Line 1627: return self._irs.add_image_ticket(ticket)
> Done
This has to return a status, otherwise the infra will fail when trying to retrieve it. I'll just return a "donecode"
Line 1628:
Line 1629: def remove_image_ticket(self, ticket_uuid):
Line 1630: return self._irs.remove_image_ticket(ticket_uuid)
Line 1631:
https://gerrit.ovirt.org/#/c/50014/10/vdsm/storage/imagetickets.py
File vdsm/storage/imagetickets.py:
Line 33: from imaged import uhttp
Line 34: from imaged.server import Config
Line 35: _have_imaged = True
Line 36: except ImportError:
Line 37: pass
> We have tow code paths, each define the correct value of _have_imaged. Both
Ok if you prefer, since I'll update the patch anyway..
Line 38:
Line 39: log = logging.getLogger('storage.imagetickets')
Line 40:
Line 41:
Line 71: try:
Line 72: with closing(con):
Line 73: con.request(method, "/tickets/%s" % ticket_uuid, body, {})
Line 74: res = con.getresponse()
Line 75: except socket.error as e:
> Are you sure that this can raise only socket.error? check httplib documenta
classes which are derived from HTTPException and socket.error can be thrown in here, I could not find any further exceptions in the docs
Line 76: raise se.ImageTicketsError("Error connecting to imaged: {errno} - "
Line 77: "{strerror}".format(errno=e.errno,
Line 78: strerror=e.strerror))
Line 79: if res.status not in (200, 204):
Line 79: if res.status not in (200, 204):
Line 80: try:
Line 81: ret_dict = json.loads(res.read(res.length))
Line 82: ret_code = ret_dict['code']
Line 83: ret_title = ret_dict['title']
> We can remove the the extra keys from the payload, as they are pass in the
I will.
Line 84: ret_expl = ret_dict['explanation']
Line 85: ret_detail = ret_dict['detail'] if 'detail' in ret_dict else None
Line 86: except Exception as e:
Line 87: raise se.ImageDeamonError(res.status, res.reason,
--
To view, visit https://gerrit.ovirt.org/50014
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I6b9ded4bde73b1ab504cae50d2cea726d4f77e51
Gerrit-PatchSet: 10
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Amit Aviram <aaviram at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Amit Aviram <aaviram at redhat.com>
Gerrit-Reviewer: Greg Padgett <gpadgett at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Liron Aravot <laravot at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list