def _translate_attachment_ref(attachment_ref):
    """Building old style connection_info by adding the 'data' key back."""
    translated_con_info = {}
    connection_info_data = attachment_ref.pop('connection_info', None)
    if connection_info_data:
        connection_info_data.pop('attachment_id', None)
        translated_con_info['driver_volume_type'] = connection_info_data.pop(
            'driver_volume_type', None)
        translated_con_info['data'] = connection_info_data
        translated_con_info['status'] = attachment_ref.pop('status', None)
        translated_con_info['instance'] = attachment_ref.pop('instance', None)
        translated_con_info['attached_at'] = attachment_ref.pop('attached_at',
            None)
        translated_con_info['detached_at'] = attachment_ref.pop('detached_at',
            None)
        for k, v in attachment_ref.items():
            if k not in ('id', 'attach_mode'):
                translated_con_info[k] = v
    attachment_ref['connection_info'] = translated_con_info
    return attachment_ref
