Exemplo n.º 1
0
 def _get_service_info(self, service, port):
     output = subprocess.check_output(["docker-compose", "port", service, str(port)],
                                      cwd=self.filepath).decode("utf-8")
     result = str(output).rstrip().split(":")
     if len(result) == 1:
         raise NoSuchPortExposed("Port {} was not exposed for service {}".format(port, service))
     return result
Exemplo n.º 2
0
 def _get_service_info(self, service, port):
     port_cmd = self.docker_compose_command() + ["port", service, str(port)]
     output = subprocess.check_output(port_cmd,
                                      cwd=self.filepath).decode("utf-8")
     result = str(output).rstrip().split(":")
     if len(result) != 2 or not all(result):
         raise NoSuchPortExposed(
             f"port {port} is not exposed for service {service}")
     return result