def install_config(path=None, **kwargs):
    '''
    Installs the given configuration file into the candidate configuration.
    Commits the changes if the commit checks or throws an error.

    Usage:

    .. code-block:: bash

        salt 'device_name' junos.install_config '/home/user/config.set' timeout=300


    Options:
      * path: Path where the configuration file is present.
      * kwargs: keyworded arguments taken by load fucntion of PyEZ
    '''
    conn = __proxy__['junos.conn']()
    ret = dict()
    ret['out'] = True

    if 'timeout' in kwargs:
        conn.timeout = kwargs['timeout']

    options = {'path': path}

    try:
        conn.cu.load(**options)
        conn.cu.pdiff()

    except Exception as exception:
        ret['message'] = 'Could not load configuration due to : "{0}"'.format(
            exception)
        ret['out'] = False

    if conn.cu.commit_check():
        ret['message'] = 'Successfully loaded and committed!'
        conn.cu.commit()
    else:
        ret['message'] = 'Commit check failed.'
        ret['out'] = False
        conn.cu.rollback()

    return ret
dataset/ETHPy150Open saltstack/salt/salt/modules/junos.py/install_config/original