Overhaul ansible-test cloud test plugins. (#53044)

This commit is contained in:
Matt Clay 2019-02-28 18:25:49 -08:00 committed by GitHub
parent 9c644d9bcc
commit eeaff731de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 338 additions and 211 deletions

View file

@ -7,11 +7,13 @@ from lib.util import (
ApplicationError,
display,
is_shippable,
ConfigParser,
)
from lib.cloud import (
CloudProvider,
CloudEnvironment,
CloudEnvironmentConfig,
)
from lib.core_ci import (
@ -84,16 +86,22 @@ class AwsCloudProvider(CloudProvider):
class AwsCloudEnvironment(CloudEnvironment):
"""AWS cloud environment plugin. Updates integration test environment after delegation."""
def configure_environment(self, env, cmd):
def get_environment_config(self):
"""
:type env: dict[str, str]
:type cmd: list[str]
:rtype: CloudEnvironmentConfig
"""
cmd.append('-e')
cmd.append('@%s' % self.config_path)
parser = ConfigParser()
parser.read(self.config_path)
cmd.append('-e')
cmd.append('resource_prefix=%s' % self.resource_prefix)
ansible_vars = dict(
resource_prefix=self.resource_prefix,
)
ansible_vars.update(dict(parser.items('default')))
return CloudEnvironmentConfig(
ansible_vars=ansible_vars,
)
def on_failure(self, target, tries):
"""