'Sets the specified host\'s ability to accept new volumes.'

def _set_enabled_status(self, req, host, enabled):

    context = req.environ['cinder.context']
    state = ('enabled' if enabled else 'disabled')
    LOG.info('Setting    host    %(host)s    to    %(state)s.', {'host': host, 'state': state})
    result = self.api.set_host_enabled(context, host=host, enabled=enabled)
    if (result not in ('enabled', 'disabled')):
        raise webob.exc.HTTPBadRequest(explanation=result)
    return {'host': host, 'status': result}
