After killing the task, we need to make sure its container has actually been removed from the agent before proceeding.
(self, timeout=TIMEOUT)
| 405 | |
| 406 | # pylint: disable=arguments-differ |
| 407 | def kill(self, timeout=TIMEOUT): |
| 408 | """ |
| 409 | After killing the task, we need to make sure its container has |
| 410 | actually been removed from the agent before proceeding. |
| 411 | """ |
| 412 | super(Task, self).kill() |
| 413 | |
| 414 | try: |
| 415 | # pylint: disable=missing-docstring |
| 416 | def container_does_not_exist(data): |
| 417 | return not any(container["executor_id"] == self.flags["name"] |
| 418 | for container in data) |
| 419 | |
| 420 | self.__wait_for_containers(container_does_not_exist, timeout) |
| 421 | except Exception as exception: |
| 422 | raise CLIException("Container with name '{name}' still" |
| 423 | " exists after timeout: {error}" |
| 424 | .format(name=self.flags["name"], |
| 425 | error=exception)) |
| 426 | |
| 427 | Task.count -= 1 |
| 428 | |
| 429 | |
| 430 | def capture_output(command, argv, extra_args=None): |