@staticmethod
def _parse_ports(ports):
    if (ports is None):
        return (None, None)
    port_mappings = ports.split(',')
    port_tuple_list = []
    for port_value_pair in port_mappings:
        p_v = port_value_pair.split('=')
        if (len(p_v) != 2):
            return (None, [f'invalid port mapping: {port_value_pair}'])
        try:
            int(p_v[1])
        except ValueError:
            return (None, [f'invalid port mapping: {port_value_pair}'])
        port_tuple_list.append((p_v[0], p_v[1]))
    return (port_tuple_list, None)
@staticmethod
def _parse_ports(ports):
    if (ports is None):
        return (None, None)
    port_mappings = ports.split(',')
    port_tuple_list = []
    for port_value_pair in port_mappings:
        p_v = port_value_pair.split('=')
        if (len(p_v) != 2):
            return (None, [f'invalid port mapping: {port_value_pair}'])
        try:
            int(p_v[1])
        except ValueError:
            return (None, [f'invalid port mapping: {port_value_pair}'])
        port_tuple_list.append((p_v[0], p_v[1]))
    return (port_tuple_list, None)