

def cas(key, value, old_value):
    "\n    Check and set a value in the minion datastore\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' data.cas <key> <value> <old_value>\n    "
    store = load()
    if (key not in store):
        return False
    if (store[key] != old_value):
        return False
    store[key] = value
    dump(store)
    return True

dataset/ETHPy150Open saltstack/salt/salt/modules/data.py cas/original