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

@wrap_exception()
@target_host_cell
def set_host_enabled(self, context, host_name, enabled):

    host_name = self._assert_host_exists(context, host_name)
    payload = {'host_name': host_name, 'enabled': enabled}
    compute_utils.notify_about_host_update(context, 'set_enabled.start', payload)
    result = self.rpcapi.set_host_enabled(context, enabled=enabled, host=host_name)
    compute_utils.notify_about_host_update(context, 'set_enabled.end', payload)
    return result
