diff options
author | jctanner <tanner.jc@gmail.com> | 2017-10-02 08:44:13 -0400 |
---|---|---|
committer | John R Barker <john@johnrbarker.com> | 2017-10-02 13:44:13 +0100 |
commit | 6b6a145027b499e6be43133c725908d04ef5aaf8 (patch) | |
tree | 0f982a61e6225e2e24c7a8932c10547f0184fd96 | |
parent | 614a2b403e36a14115723a79889c199debe82b67 (diff) | |
download | ansible-6b6a145027b499e6be43133c725908d04ef5aaf8.tar.gz |
Add an option to spawn vcsim in esx mode (#31155)
-rwxr-xr-x | test/utils/docker/vcenter-simulator/flask_control.py | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/test/utils/docker/vcenter-simulator/flask_control.py b/test/utils/docker/vcenter-simulator/flask_control.py index 1ea8cb5b34..2c70d7a230 100755 --- a/test/utils/docker/vcenter-simulator/flask_control.py +++ b/test/utils/docker/vcenter-simulator/flask_control.py @@ -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' |