summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2024-08-06 20:21:12 -0500
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-08-08 13:12:41 +0000
commit3c556eda35a49d7088d4b5b1ff281854cad94bef (patch)
treebc7360523e9e68a90aed7b47cb363e4a46366c2d /python
parentc0ce26f995e48e29050791a6adb4bc09a2630201 (diff)
downloadvyos-1x-3c556eda35a49d7088d4b5b1ff281854cad94bef.tar.gz
vyos-1x-3c556eda35a49d7088d4b5b1ff281854cad94bef.zip
configd: T6640: enforce in_session returns False under configdmergify/bp/circinus/pr-3955
The CStore in_session check is a false positive outside of a config session if a specific environment variable is set with an existing referent in unionfs. To allow extensions when running under configd and avoid confusion, enforce in_session returns False. (cherry picked from commit 6543f444c42ff45e8115366256643186bf1dd567)
Diffstat (limited to 'python')
-rw-r--r--python/vyos/configsource.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/python/vyos/configsource.py b/python/vyos/configsource.py
index f582bdfab..59e5ac8a1 100644
--- a/python/vyos/configsource.py
+++ b/python/vyos/configsource.py
@@ -204,6 +204,8 @@ class ConfigSourceSession(ConfigSource):
Returns:
True if called from a configuration session, False otherwise.
"""
+ if os.getenv('VYOS_CONFIGD', ''):
+ return False
try:
self._run(self._make_command('inSession', ''))
return True