def _set_host_maintenance(self, context, host_name, mode=True):
        LOG.info(_LI("Putting host %(host_name)s in maintenance mode "
                    "%(mode)s."),
                  {'host_name': host_name, 'mode': mode})
        try:
            result = self.api.set_host_maintenance(context, host_name, mode)
        except NotImplementedError:
            common.raise_feature_not_supported()
        except exception.HostNotFound as e:
            raise webob.exc.HTTPNotFound(explanation=e.format_message())
        except exception.ComputeServiceUnavailable as e:
            raise webob.exc.HTTPBadRequest(explanation=e.format_message())
        if result not in ("on_maintenance", "off_maintenance"):
            raise webob.exc.HTTPBadRequest(explanation=result)
        return result
This is called when the proxy-minion is exiting to make sure the
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/api/openstack/compute/hosts.py/HostController._set_host_maintenance--crossover with--dataset/ETHPy150Open saltstack/salt/salt/proxy/junos.py/shutdown