diff options
author | John Estabrook <jestabro@vyos.io> | 2023-06-27 15:36:12 -0500 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2023-06-28 11:52:16 -0500 |
commit | 186d05c3c792ea1c61e8f0e68fd7006917244660 (patch) | |
tree | a700c12c209d310211aed8db02a3c7f4f356e819 /python | |
parent | 3d006d519ca99b71096d0028a9190e43eaa35f86 (diff) | |
download | vyos-1x-186d05c3c792ea1c61e8f0e68fd7006917244660.tar.gz vyos-1x-186d05c3c792ea1c61e8f0e68fd7006917244660.zip |
T5320: check if unsaved commits are due to boot config error
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/util.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/python/vyos/util.py b/python/vyos/util.py index e62f9d5cf..33da5da40 100644 --- a/python/vyos/util.py +++ b/python/vyos/util.py @@ -1139,6 +1139,19 @@ def boot_configuration_complete() -> bool: return True return False +def boot_configuration_success() -> bool: + from vyos.defaults import config_status + + try: + with open(config_status) as f: + res = f.read().strip() + except FileNotFoundError: + return False + + if int(res) == 0: + return True + return False + def sysctl_read(name): """ Read and return current value of sysctl() option """ tmp = cmd(f'sysctl {name}') |