.. versionadded:: 2019.2.0

    Return the diff, as Python dictionary, between two different sources.
    The sources can be either specified using the ``source1`` and ``source2``
    arguments when retrieving from the managed network device.

    source1: ``candidate``
        The source from where to retrieve the configuration to be compared with.
        Available options: ``candidate``, ``running``, ``startup``. Default:
        ``candidate``.

    candidate_path
        Absolute or remote path from where to load the candidate configuration
        text. This argument allows any URI supported by
        :py:func:`cp.get_url <salt.modules.cp.get_url>`), e.g., ``salt://``,
        ``https://``, ``s3://``, ``ftp:/``, etc.

    source2: ``running``
        The source from where to retrieve the configuration to compare with.
        Available options: ``candidate``, ``running``, ``startup``. Default:
        ``running``.

    running_path
        Absolute or remote path from where to load the runing configuration
        text. This argument allows any URI supported by
        :py:func:`cp.get_url <salt.modules.cp.get_url>`), e.g., ``salt://``,
        ``https://``, ``s3://``, ``ftp:/``, etc.

    saltenv: ``base``
        Salt fileserver environment from which to retrieve the file.
        Ignored if ``candidate_path`` or ``running_path`` is not a
        ``salt://`` URL.

    CLI Example:

    .. code-block:: bash

        salt '*' napalm.config_diff_text
        salt '*' napalm.config_diff_text candidate_path=https://bit.ly/2mAdq7z
        # Would compare the running config with the configuration available at
        # https://bit.ly/2mAdq7z

    CLI Example:

    .. code-block:: bash

        salt '*' napalm.config_diff_tree
        salt '*' napalm.config_diff_tree running startup

def config_diff_tree(source1='candidate',
                     candidate_path=None,
                     source2='running',
                     running_path=None):
    '''
    .. versionadded:: 2019.2.0

    Return the diff, as Python dictionary, between two different sources.
    The sources can be either specified using the ``source1`` and ``source2``
    arguments when retrieving from the managed network device.

    source1: ``candidate``
        The source from where to retrieve the configuration to be compared with.
        Available options: ``candidate``, ``running``, ``startup``. Default:
        ``candidate``.

    candidate_path
        Absolute or remote path from where to load the candidate configuration
        text. This argument allows any URI supported by
        :py:func:`cp.get_url <salt.modules.cp.get_url>`), e.g., ``salt://``,
        ``https://``, ``s3://``, ``ftp:/``, etc.

    source2: ``running``
        The source from where to retrieve the configuration to compare with.
        Available options: ``candidate``, ``running``, ``startup``. Default:
        ``running``.

    running_path
        Absolute or remote path from where to load the runing configuration
        text. This argument allows any URI supported by
        :py:func:`cp.get_url <salt.modules.cp.get_url>`), e.g., ``salt://``,
        ``https://``, ``s3://``, ``ftp:/``, etc.

    saltenv: ``base``
        Salt fileserver environment from which to retrieve the file.
        Ignored if ``candidate_path`` or ``running_path`` is not a
        ``salt://`` URL.

    CLI Example:

    .. code-block:: bash

        salt '*' napalm.config_diff_text
        salt '*' napalm.config_diff_text candidate_path=https://bit.ly/2mAdq7z
        # Would compare the running config with the configuration available at
        # https://bit.ly/2mAdq7z

    CLI Example:

    .. code-block:: bash

        salt '*' napalm.config_diff_tree
        salt '*' napalm.config_diff_tree running startup
    '''
    get_config = __salt__['net.config']()['out']
    candidate_cfg = get_config[source1]
    running_cfg = get_config[source2]
    return __salt__['iosconfig.diff_tree'](candidate_config=candidate_cfg,
                                           candidate_path=candidate_path,
                                           running_config=running_cfg,
                                           running_path=running_path)