

def dump(new_data):
    "\n    Replace the entire datastore with a passed data structure\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' data.dump '{'eggs': 'spam'}'\n    "
    if (not isinstance(new_data, dict)):
        if isinstance(ast.literal_eval(datastore_path), dict):
            new_data = ast.literal_eval(new_data)
        else:
            return False
    try:
        datastore_path = os.path.join(__opts__['cachedir'], 'datastore')
        with salt.utils.fopen(datastore_path, 'w+b') as fn_:
            serial = salt.payload.Serial(__opts__)
            serial.dump(new_data, fn_)
        return True
    except (IOError, OSError, NameError):
        return False

dataset/ETHPy150Open saltstack/salt/salt/modules/data.py dump/VarMisuse@32/105 `new_data`->`datastore_path`