From 186d05c3c792ea1c61e8f0e68fd7006917244660 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Tue, 27 Jun 2023 15:36:12 -0500 Subject: T5320: check if unsaved commits are due to boot config error --- python/vyos/util.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'python') 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}') -- cgit v1.2.3