summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-12-18 15:32:14 -0600
committerJohn Estabrook <jestabro@vyos.io>2023-12-18 22:27:25 -0600
commit80077eee89e4f0aa3af5dca1a4b2b5e1665bda6f (patch)
tree5caa5ae702918f68539567f398922a41cbe64d3c
parentf2cd94167433903b803157fefba1ee9e00312f3b (diff)
downloadvyos-1x-80077eee89e4f0aa3af5dca1a4b2b5e1665bda6f.tar.gz
vyos-1x-80077eee89e4f0aa3af5dca1a4b2b5e1665bda6f.zip
configdep: T5836: add boolean check whether script called as dependency
-rw-r--r--python/vyos/configdep.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/python/vyos/configdep.py b/python/vyos/configdep.py
index 8a28811eb..64727d355 100644
--- a/python/vyos/configdep.py
+++ b/python/vyos/configdep.py
@@ -107,6 +107,13 @@ def call_dependents():
f = l.pop(0)
f()
+def called_as_dependent() -> bool:
+ st = stack()[1:]
+ for f in st:
+ if f.filename == __file__:
+ return True
+ return False
+
def graph_from_dependency_dict(d: dict) -> dict:
g = {}
for k in list(d):