diff options
author | James Tanner <tanner.jc@gmail.com> | 2017-10-16 12:05:12 -0400 |
---|---|---|
committer | jctanner <tanner.jc@gmail.com> | 2017-10-16 21:50:31 -0400 |
commit | cc287daa3b16fa5685ca5e8df35d6dad4f9fad0b (patch) | |
tree | b08ba3d957092c77042a1fdf841ab7894b78f339 /test/utils | |
parent | e5eedfe4b8ee387a779e922f57504cb9c3c2f0fd (diff) | |
download | ansible-cc287daa3b16fa5685ca5e8df35d6dad4f9fad0b.tar.gz |
Enable tracing and log collection in the vcsim container
Diffstat (limited to 'test/utils')
-rwxr-xr-x | test/utils/docker/vcenter-simulator/flask_control.py | 16 | ||||
-rwxr-xr-x | test/utils/docker/vcenter-simulator/make.sh | 2 |
2 files changed, 16 insertions, 2 deletions
diff --git a/test/utils/docker/vcenter-simulator/flask_control.py b/test/utils/docker/vcenter-simulator/flask_control.py index 2c70d7a230..ff6b7166a7 100755 --- a/test/utils/docker/vcenter-simulator/flask_control.py +++ b/test/utils/docker/vcenter-simulator/flask_control.py @@ -41,6 +41,16 @@ def m_index(): return 'vcsim controller' +@app.route('/log') +def get_log(): + """Read and return the vcsim log""" + fdata = '' + if os.path.isfile('vcsim.log'): + with open('vcsim.log', 'rb') as f: + fdata = f.read() + return fdata + + @app.route('/kill/<int:number>') def kill_one(number): """Kill any arbitrary process id""" @@ -133,6 +143,10 @@ def spawn_vcsim(): '%s:%s' % (hostname, port), ] + # trace soap requests+responses + if trace: + cmd.append('-trace') + # esx only allows certain arguments if request.args.get('esx'): cmd.append('-esx') @@ -151,7 +165,7 @@ def spawn_vcsim(): default = request.args.get(name) cmd.append('-%s=%s' % (name, default)) cmd = ' '.join(cmd) - cmd += ' 2>&1 > vcsim.log' + cmd += ' > vcsim.log 2>&1' # run it with environment settings p = subprocess.Popen( diff --git a/test/utils/docker/vcenter-simulator/make.sh b/test/utils/docker/vcenter-simulator/make.sh index 775c29302f..589d949577 100755 --- a/test/utils/docker/vcenter-simulator/make.sh +++ b/test/utils/docker/vcenter-simulator/make.sh @@ -1,3 +1,3 @@ #!/bin/bash -docker build -t ansible:vcenter-simulator . +docker build --no-cache -t ansible:vcenter-simulator . |