Development
This commit is contained in:
parent
cd667c5009
commit
3ee1a6f0de
3 changed files with 24 additions and 7 deletions
|
|
@ -328,7 +328,7 @@ def _items_match(item, ref):
|
|||
return item == ref
|
||||
|
||||
|
||||
def revert_snapshot_to_core(entry_uuid):
|
||||
def revert_snapshot_to_config(entry_uuid):
|
||||
"""Apply the inverse of a snapshot to config.json and queue a new pending change.
|
||||
|
||||
Returns (flash_message, success_bool).
|
||||
|
|
@ -388,10 +388,10 @@ def load_snapshot_for_uuid(entry_uuid):
|
|||
return None
|
||||
|
||||
|
||||
def save_config_with_snapshot(new_core, path, key, operation, before, after,
|
||||
def save_config_with_snapshot(new_config, path, key, operation, before, after,
|
||||
description='', cmd='core apply', queue=True):
|
||||
"""
|
||||
Write a .snapshots/{ts}-{uuid}.json file, save new_core to disk, and
|
||||
Write a .snapshots/{ts}-{uuid}.json file, save new_config to disk, and
|
||||
optionally create a pending queue entry. Returns a flash message string.
|
||||
|
||||
queue=False: skips queueing and records the change directly in
|
||||
|
|
@ -420,7 +420,7 @@ def save_config_with_snapshot(new_core, path, key, operation, before, after,
|
|||
with open(os.path.join(SNAPSHOTS_DIR, f'{entry_ts}-{entry_uuid}.json'), 'w') as f:
|
||||
json.dump(snapshot, f, indent=2)
|
||||
|
||||
save_config(new_core)
|
||||
save_config(new_config)
|
||||
|
||||
if not queue:
|
||||
with open(DASHBOARD_DONE, 'a') as f:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue