【发布时间】:2021-07-28 01:58:47
【问题描述】:
我有这个 python 代码:
command = "kubectl exec -it " + jmeter_pod + " -n " + namespace + " -- bash -c \"echo "+ ext_ip_lfe +">nelshost\" "
process = subprocess.Popen(command.split(' '), stdout=subprocess.PIPE)
output = process.communicate()[0].decode('utf-8')
我有这段代码在执行时会在“proces = ...”步骤返回此错误:
10.117.142.201>nelshost": -c: line 0: unexpected EOF while looking for matching `"'
10.117.142.201>nelshost": -c: line 1: syntax error: unexpected end of file
command terminated with exit code 1
有人可以帮我吗?
【问题讨论】:
标签: python docker kubernetes kubectl popen