summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2023-06-29 00:07:47 +0100
committerGitHub <noreply@github.com>2023-06-29 00:07:47 +0100
commit88282bed3b9a91f3a1cd645fee89fe38d8735de6 (patch)
treea700c12c209d310211aed8db02a3c7f4f356e819 /python/vyos
parent6a2ddc478d61db6b177bd7ac49dcff0df9f69db8 (diff)
parent186d05c3c792ea1c61e8f0e68fd7006917244660 (diff)
downloadvyos-1x-88282bed3b9a91f3a1cd645fee89fe38d8735de6.tar.gz
vyos-1x-88282bed3b9a91f3a1cd645fee89fe38d8735de6.zip
Merge pull request #2060 from jestabro/warning-boot-config-err
T5320: warn on entering config mode if boot config errors present
Diffstat (limited to 'python/vyos')
-rw-r--r--python/vyos/util.py13
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}')