

def commit():
    "\n    To commit the changes loaded in the candidate configuration.\n\n    Usage:\n\n    .. code-block:: bash\n\n        salt 'device_name' junos.commit\n\n    "
    conn = __proxy__['junos.conn']()
    ret = {
        
    }
    commit_ok = conn.cu.commit_check()
    if commit_ok:
        try:
            conn.cu.commit(confirm=True)
            ret['out'] = True
            ret['message'] = 'Commit Successful.'
        except Exception as exception:
            ret['out'] = False
            ret['message'] = 'Pre-commit check succeeded but actual commit failed with "{0}"'.format(exception)
    else:
        ret['out'] = False
        ret['message'] = 'Pre-commit check failed.'
    return ret

dataset/ETHPy150Open saltstack/salt/salt/modules/junos.py commit/original