From e5eedfe4b8ee387a779e922f57504cb9c3c2f0fd Mon Sep 17 00:00:00 2001 From: James Tanner Date: Mon, 16 Oct 2017 12:04:45 -0400 Subject: [PATCH] Allow the user to declare an env var to set the vcsim container image --- test/runner/lib/cloud/vcenter.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/runner/lib/cloud/vcenter.py b/test/runner/lib/cloud/vcenter.py index 3515cbb59b..5e80f6462f 100644 --- a/test/runner/lib/cloud/vcenter.py +++ b/test/runner/lib/cloud/vcenter.py @@ -40,7 +40,10 @@ class VcenterProvider(CloudProvider): super(VcenterProvider, self).__init__(args, config_extension='.ini') # The simulator must be pinned to a specific version to guarantee CI passes with the version used. - self.image = 'ansible/ansible:vcenter-simulator@sha256:1a92e84f477ae4c45f9070a5419a0fc2b46abaecdb5bc396826741bca65ce028' + if os.environ.get('ANSIBLE_VCSIM_CONTAINER'): + self.image = os.environ.get('ANSIBLE_VCSIM_CONTAINER') + else: + self.image = 'ansible/ansible:vcenter-simulator@sha256:1a92e84f477ae4c45f9070a5419a0fc2b46abaecdb5bc396826741bca65ce028' self.container_name = '' def filter(self, targets, exclude): @@ -118,7 +121,9 @@ class VcenterProvider(CloudProvider): else: publish_ports = [] - docker_pull(self.args, self.image) + if not os.environ.get('ANSIBLE_VCSIM_CONTAINER'): + docker_pull(self.args, self.image) + docker_run( self.args, self.image,