def get_device_system_ports(cfg_facts):
    """Returns the system ports from the config facts as a single dictionary, instead of a nested dictionary.

    The ansible module for config facts automatically makes a 2 level nested dictionary when the keys are in the form
    of part1|part2|part3 or part1|part2.  The first dictionary is keyed as "part1" and the nested dictionary is the
    remainder of the key with the value.  This function returns a flat dictionary with the keys restored to their values
    from the files.

   Args:
        cfg_facts: The "ansible_facts" output from the duthost "config_facts" module.

    Returns:
        The system port config facts in a single layer dictionary.

    """

    sys_port_slot_dict = cfg_facts['SYSTEM_PORT']
    merge_dict = {}
    for slot in sys_port_slot_dict:
        for port in sys_port_slot_dict[slot]:
            merge_dict[slot + "|" + port] = sys_port_slot_dict[slot][port]
    return merge_dict