mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Overhaul ansible-test cloud test plugins. (#53044)
This commit is contained in:
@@ -2,11 +2,13 @@
|
||||
|
||||
from lib.cloud import (
|
||||
CloudProvider,
|
||||
CloudEnvironment
|
||||
CloudEnvironment,
|
||||
CloudEnvironmentConfig,
|
||||
)
|
||||
|
||||
from lib.util import (
|
||||
display,
|
||||
ConfigParser,
|
||||
)
|
||||
|
||||
|
||||
@@ -43,14 +45,19 @@ class OpenNebulaCloudEnvironment(CloudEnvironment):
|
||||
"""
|
||||
Updates integration test environment after delegation. Will setup the config file as parameter.
|
||||
"""
|
||||
|
||||
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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user