'Update bootable status of a volume.'

@wsgi.action('os-set_bootable')
def _set_bootable(self, req, id, body):

    context = req.environ['cinder.context']
    volume = self.volume_api.get(context, id)
    try:
        bootable = body['os-set_bootable']['bootable']
    except KeyError:
        msg = _('Must    specify    bootable    in    request.')
        raise webob.exc.HTTPBadRequest(explanation=msg)
    try:
        bootable = strutils.bool_from_string(bootable, strict=True)
    except ValueError as error:
        err_msg = encodeutils.exception_to_unicode(error)
        msg = (_("Invalid    value    for    'bootable':    '%s'") % err_msg)
        raise webob.exc.HTTPBadRequest(explanation=msg)
    update_dict = {'bootable': bootable}
    self.volume_api.update(context, volume, update_dict)
    return webob.Response(status_int=http_client.OK)
