Exemplo n.º 1
0
    def delete(self, worker_api):
        """ Delete a host instance

        :param id: id of the host to delete
        :return:
        """

        cleanup_host(worker_api)
        return True
Exemplo n.º 2
0
    def delete(self, daemon_url):
        """ Delete a host instance

        :param id: id of the host to delete
        :return:
        """

        cleanup_host(daemon_url)
        return True
Exemplo n.º 3
0
    def delete(self, worker_api):
        """ Delete a host instance

        :param id: id of the host to delete
        :return:
        """

        cleanup_host(worker_api)
        return True
Exemplo n.º 4
0
    def delete(self, id):
        """ Delete a host instance

        :param id: id of the host to delete
        :return:
        """
        logger.debug("Delete a host with id={0}".format(id))

        h = self.get_by_id(id)
        if not h:
            logger.warning("Cannot delete non-existed host")
            return False
        if h.get("clusters", ""):
            logger.warning("There are clusters on that host, cannot delete.")
            return False
        cleanup_host(h.get("daemon_url"))
        self.col.delete_one({"id": id})
        return True
Exemplo n.º 5
0
    def delete(self, id):
        """ Delete a host instance

        :param id: id of the host to delete
        :return:
        """
        logger.debug("Delete a host with id={0}".format(id))

        h = self.get_by_id(id)
        if not h:
            logger.warning("Cannot delete non-existed host")
            return False
        if h.get("clusters", ""):
            logger.warning("There are clusters on that host, cannot delete.")
            return False
        cleanup_host(h.get("daemon_url"))
        self.col.delete_one({"id": id})
        return True