def set_host_enabled(self, host, enabled):
        """Sets the specified host's ability to accept new instances."""
        args = {"enabled": json.dumps(enabled)}
        xenapi_resp = self._call_xenhost("set_host_enabled", args)
        try:
            resp = json.loads(xenapi_resp)
        except __HOLE__ as e:
            # Already logged; return the message
            return xenapi_resp.details[-1]
        return resp["status"]
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/virt/xenapi/vmops.py/VMOps.set_host_enabled