def parse_ports(port_string):
    """Convert a port specification string into a list of ports."""
    ports = set()
    for range_string in port_string.split(","):
        port_range = [int(port) for port in range_string.split("-")]
        ports = ports.union(set(range(min(port_range), max(port_range) + 1)))
    return sorted(ports)