| def kill_container(self): | |
| '' | |
| container_name = self.config.container_name | |
| if container_name: | |
| container_cli = self.config.process_isolation_executable | |
| cmd = '{} kill {}'.format(container_cli, container_name) | |
| proc = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True) | |
| _, stderr = proc.communicate() | |
| if proc.returncode: | |
| logger.info('Error from {} kill {} command: | |
| {}'.format(container_cli, container_name, stderr)) | |
| else: | |
| logger.info("Killed container {}".format(container_name)) | |