Skip to content

Commit

Permalink
Add an option to spawn vcsim in esx mode (ansible#31155)
Browse files Browse the repository at this point in the history
  • Loading branch information
jctanner authored and gundalow committed Oct 2, 2017
1 parent 614a2b4 commit 6b6a145
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions test/utils/docker/vcenter-simulator/flask_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,24 @@ def spawn_vcsim():
'-httptest.serve',
'%s:%s' % (hostname, port),
]
for x in cli_opts:
name = x[0]
default = x[1]
if request.args.get(name):
default = request.args.get(name)
cmd.append('-%s=%s' % (name, default))

# esx only allows certain arguments
if request.args.get('esx'):
cmd.append('-esx')
for x in [('vm', 1), ('ds', 1)]:
name = x[0]
default = x[1]
if request.args.get(name):
default = request.args.get(name)
cmd.append('-%s=%s' % (name, default))
else:
# use all other options as requested for vcenter
for x in cli_opts:
name = x[0]
default = x[1]
if request.args.get(name):
default = request.args.get(name)
cmd.append('-%s=%s' % (name, default))
cmd = ' '.join(cmd)
cmd += ' 2>&1 > vcsim.log'

Expand Down

0 comments on commit 6b6a145

Please sign in to comment.