summaryrefslogtreecommitdiff
path: root/python/vyos/config.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-01-24 14:00:44 +0100
committerChristian Poessinger <christian@poessinger.com>2020-01-24 14:00:45 +0100
commit94bf34511c28a48ae5f548c9f50acf8ef85f5ce6 (patch)
tree20228e21f39fd3777193e0bb189b77fb7a7ce5ec /python/vyos/config.py
parente74d1453739ff518713ed25edc632f0519148f1e (diff)
downloadvyos-1x-94bf34511c28a48ae5f548c9f50acf8ef85f5ce6.tar.gz
vyos-1x-94bf34511c28a48ae5f548c9f50acf8ef85f5ce6.zip
Python: T1986: close subprocess channel
Without closing the communication channel to the subprocess, Python will complain e.g. when executing vyos-smoketest binary. /usr/lib/python3/dist-packages/vyos/configsession.py:110: ResourceWarning: unclosed file <_io.BufferedReader name=3> self.__run_command([CLI_SHELL_API, 'setupSession']) ResourceWarning: Enable tracemalloc to get the object allocation traceback
Diffstat (limited to 'python/vyos/config.py')
-rw-r--r--python/vyos/config.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/python/vyos/config.py b/python/vyos/config.py
index 6aed8693c..77698ac68 100644
--- a/python/vyos/config.py
+++ b/python/vyos/config.py
@@ -140,6 +140,7 @@ class Config(object):
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
out = p.stdout.read()
p.wait()
+ p.communicate()
if p.returncode != 0:
raise VyOSError()
else: