def _check_container_status(self): if self.initialized: return True output = self.ssh_command_runner.run( check_docker_running_cmd(self.container_name), with_output=True).decode("utf-8").strip() # Checks for the false positive where "true" is in the container name return ("true" in output.lower() and "no such object" not in output.lower())
def _check_container_status(self): no_exist = "not_present" cmd = check_docker_running_cmd(self.docker_name) + " ".join( ["||", "echo", quote(no_exist)]) output = self.ssh_command_runner.run( cmd, with_output=True).decode("utf-8").strip() if no_exist in output: return False return "true" in output.lower()