summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2024-06-20 21:47:47 -0500
committerGitHub <noreply@github.com>2024-06-20 21:47:47 -0500
commitc6190f37908bb4486ecce6a5cabb752c19b67c7f (patch)
treed6e19e137bdf855d71ab5d976e3f2c314fcd36f5 /python
parent442bf37dbccbcb9f47333543742fa7aa665bb417 (diff)
parent8281383a09f12da20a1c9b4864b38ac3f541b48f (diff)
downloadvyos-1x-c6190f37908bb4486ecce6a5cabb752c19b67c7f.tar.gz
vyos-1x-c6190f37908bb4486ecce6a5cabb752c19b67c7f.zip
Merge pull request #3654 from talmakion/bugfix/T5514
op-mode: T5514: Allow safe reboots to config defaults when config.boot is deleted
Diffstat (limited to 'python')
-rw-r--r--python/vyos/config_mgmt.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/python/vyos/config_mgmt.py b/python/vyos/config_mgmt.py
index 70b6ea203..d518737ca 100644
--- a/python/vyos/config_mgmt.py
+++ b/python/vyos/config_mgmt.py
@@ -81,9 +81,11 @@ def save_config(target, json_out=None):
if rc != 0:
logger.critical(f'save config failed: {out}')
-def unsaved_commits() -> bool:
+def unsaved_commits(allow_missing_config=False) -> bool:
if get_full_version_data()['boot_via'] == 'livecd':
return False
+ if allow_missing_config and not os.path.exists(config_file):
+ return True
tmp_save = '/tmp/config.running'
save_config(tmp_save)
ret = not cmp(tmp_save, config_file, shallow=False)