Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T1846 Fix Config-object being affected by the shell env #174

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion python/vyos/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,13 @@ def _run(self, cmd):
if self.__session_env:
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, env=self.__session_env)
else:
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
# Clear out the VYATTA_*_LEVEL variables to ensure that we are operating on
# the full configuration instead of a child node based on the edit level
# of the caller.
env = os.environ
env['VYATTA_TEMPLATE_LEVEL'] = '/'
env['VYATTA_EDIT_LEVEL'] = '/'
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, env=env)
out = p.stdout.read()
p.wait()
if p.returncode != 0:
Expand Down