def normaliseports(ports):
    """Normalise port list

    Parameters
    ----------
    ports : str
        Comma separated list of ports

    Returns
    -------
    str | List
        If None - set to all
        Otherwise make sorted list
    """

    if ports is None:
        return 'all'

    if ports in ('all', 'update', 'test'):
        return ports

    # use a set to remove possible duplicate values
    return sorted(list(set(map(int, ports.split(',')))))