def device_dict(ring_data):
    """
    Create a dictionary that contains the devices from the ring structure
    The dictionary key is the device ID, the value is the
    (device ip address, device name) pair

    :param ring_data: ring dat structure

    :returns: dictionary that contains the devices from the ring structure
              the dictionary maps the device ID to its node ip and name
    """

    ret_dict = {}
    for device in ring_data.to_dict()['devs']:
        if device is None:
            continue
        ret_dict[str(device['id'])] = (device['ip'], device['device'])

    return ret_dict