Use multiple AWS regions in ansible-test. (#20429)

* Move ansible-test EnvironmentConfig to util.
* Use multiple AWS regions in ansible-test.
This commit is contained in:
Matt Clay 2017-01-18 16:31:34 -08:00 committed by GitHub
parent 5a48c7ac7a
commit 4ba9f63afe
6 changed files with 108 additions and 63 deletions

View file

@ -5,7 +5,6 @@ from __future__ import absolute_import, print_function
import glob
import os
import tempfile
import sys
import time
import textwrap
import functools
@ -31,6 +30,7 @@ from lib.manage_ci import (
from lib.util import (
CommonConfig,
EnvironmentConfig,
ApplicationWarning,
ApplicationError,
SubprocessError,
@ -1037,17 +1037,6 @@ def detect_changes_local(args):
return sorted(names)
def docker_qualify_image(name):
"""
:type name: str
:rtype: str
"""
if not name or any((c in name) for c in ('/', ':')):
return name
return 'ansible/ansible:%s' % name
def get_integration_filter(args, targets):
"""
:type args: IntegrationConfig
@ -1192,48 +1181,6 @@ class SanityFunc(SanityTest):
self.intercept = intercept
class EnvironmentConfig(CommonConfig):
"""Configuration common to all commands which execute in an environment."""
def __init__(self, args, command):
"""
:type args: any
"""
super(EnvironmentConfig, self).__init__(args)
self.command = command
self.local = args.local is True
if args.tox is True or args.tox is False or args.tox is None:
self.tox = args.tox is True
self.tox_args = 0
self.python = args.python if 'python' in args else None # type: str
else:
self.tox = True
self.tox_args = 1
self.python = args.tox # type: str
self.docker = docker_qualify_image(args.docker) # type: str
self.remote = args.remote # type: str
self.docker_privileged = args.docker_privileged if 'docker_privileged' in args else False # type: bool
self.docker_util = docker_qualify_image(args.docker_util if 'docker_util' in args else '') # type: str
self.docker_pull = args.docker_pull if 'docker_pull' in args else False # type: bool
self.tox_sitepackages = args.tox_sitepackages # type: bool
self.remote_stage = args.remote_stage # type: str
self.requirements = args.requirements # type: bool
self.python_version = self.python or '.'.join(str(i) for i in sys.version_info[:2])
self.delegate = self.tox or self.docker or self.remote
if self.delegate:
self.requirements = True
class TestConfig(EnvironmentConfig):
"""Configuration common to all test commands."""
def __init__(self, args, command):