def _get_valid_port(self, port):
        """
        :param port:
        :return "port/protocol":
        """
        if '/' in port:
            port, protocol = port.split('/')
        else:
            protocol = 'tcp'

        try:
            int(port)
        except ValueError:
            raise ValueError("{0} isn't a valid port number.".format(port))

        if protocol not in ('tcp', 'udp'):
            raise ValueError("exposed ports only supports udp or tcp. {0} was passed".format(protocol))

        return "{0}/{1}".format(port, protocol)
def _get_valid_port ( self , port ) : if '/' in port : port , protocol = port . split ( '/' ) else : protocol = 'tcp' try : int ( port ) except ValueError : raise ValueError ( "{0} isn't a valid port number." . format ( port ) ) if protocol not in ( 'tcp' , 'udp' ) : raise ValueError ( "exposed ports only supports udp or tcp. {0} was passed" . format ( protocol ) ) return "{0}/{1}" . format ( port , protocol )
:param port:
        :return "port/protocol":