Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #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