When setting up the ssh config, commands were executed without proper
handling of the output. By that, output was emitted on stdout, which
interfered with the output of the shell or the dump plugin.
This patch fixes this by running these commands using the run_cmd
infrastructure.
Signed-off-by: Felix Moessbauer <
felix.mo...@siemens.com>
---
kas/libkas.py | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/kas/libkas.py b/kas/libkas.py
index bd447ed73..fee9c2749 100644
--- a/kas/libkas.py
+++ b/kas/libkas.py
@@ -334,17 +334,17 @@ def ssh_cleanup_agent():
"""
Removes the identities and stops the ssh-agent instance
"""
- env = get_context().environ
+ ctx = get_context()
# remove the identities
- process = Popen(['ssh-add', '-D'], env=env)
- process.wait()
- if process.returncode != 0:
+ (ret, _) = run_cmd(['ssh-add', '-D'], cwd=ctx.kas_work_dir,
+ env=ctx.environ, fail=False, liveupdate=False)
+ if ret != 0:
logging.error('failed to delete SSH identities')
# stop the ssh-agent
- process = Popen(['ssh-agent', '-k'], env=env)
- process.wait()
- if process.returncode != 0:
+ (ret, _) = run_cmd(['ssh-agent', '-k'], cwd=ctx.kas_work_dir,
+ env=ctx.environ, fail=False, liveupdate=False)
+ if ret != 0:
logging.error('failed to stop SSH agent')
--
2.39.2