Improve ansible-test python interpreter selection. (#54445)

This commit is contained in:
Matt Clay 2019-03-27 16:40:27 -07:00 committed by GitHub
commit 785afc7a53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 203 additions and 99 deletions

View file

@ -49,8 +49,10 @@ class ManageWindowsCI(object):
for ssh_option in sorted(ssh_options):
self.ssh_args += ['-o', '%s=%s' % (ssh_option, ssh_options[ssh_option])]
def setup(self):
"""Used in delegate_remote to setup the host, no action is required for Windows."""
def setup(self, python_version):
"""Used in delegate_remote to setup the host, no action is required for Windows.
:type python_version: str
"""
pass
def wait(self):
@ -204,15 +206,17 @@ class ManagePosixCI(object):
elif self.core_ci.platform == 'rhel':
self.become = ['sudo', '-in', 'bash', '-c']
def setup(self):
"""Start instance and wait for it to become ready and respond to an ansible ping."""
def setup(self, python_version):
"""Start instance and wait for it to become ready and respond to an ansible ping.
:type python_version: str
"""
self.wait()
if isinstance(self.core_ci.args, ShellConfig):
if self.core_ci.args.raw:
return
self.configure()
self.configure(python_version)
self.upload_source()
def wait(self):
@ -227,10 +231,12 @@ class ManagePosixCI(object):
raise ApplicationError('Timeout waiting for %s/%s instance %s.' %
(self.core_ci.platform, self.core_ci.version, self.core_ci.instance_id))
def configure(self):
"""Configure remote host for testing."""
def configure(self, python_version):
"""Configure remote host for testing.
:type python_version: str
"""
self.upload('test/runner/setup/remote.sh', '/tmp')
self.ssh('chmod +x /tmp/remote.sh && /tmp/remote.sh %s' % self.core_ci.platform)
self.ssh('chmod +x /tmp/remote.sh && /tmp/remote.sh %s %s' % (self.core_ci.platform, python_version))
def upload_source(self):
"""Upload and extract source."""