def _parse_driver_info(node):
    """Gets the information needed for accessing the node.

    :param node: the Node object.
    :returns: dictionary of information.
    :raises: InvalidParameterValue if any required parameters are incorrect.
    :raises: MissingParameterValue if any required parameters are missing.

    """
    info = node.driver_info
    d_info = {}
    error_msgs = []

    d_info['username'] = info.get('fuel_username', 'root')
    d_info['key_filename'] = info.get('fuel_key_filename',
                                      '/etc/ironic/fuel_key')

    if not os.path.isfile(d_info['key_filename']):
        error_msgs.append(_("SSH key file %s not found.") %
                          d_info['key_filename'])

    try:
        d_info['port'] = int(info.get('fuel_ssh_port', 22))
    except __HOLE__:
        error_msgs.append(_("'fuel_ssh_port' must be an integer."))

    if error_msgs:
        msg = (_('The following errors were encountered while parsing '
                 'driver_info:\n%s') % '\n'.join(error_msgs))
        raise exception.InvalidParameterValue(msg)

    d_info['script'] = info.get('fuel_deploy_script', 'bareon-provision')

    return d_info
dataset/ETHPy150Open openstack/bareon/contrib/ironic/ironic-fa-deploy/ironic_fa_deploy/modules/fuel_agent.py/_parse_driver_info