mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 03:00:23 -07:00
Improve Tower integration test support:
- Add TOWER_VERSION environment variable. - Add error check for missing configuration.
This commit is contained in:
parent
70c0875dbc
commit
981e89117a
1 changed files with 6 additions and 0 deletions
|
@ -205,6 +205,7 @@ class TowerConfig(object):
|
||||||
:rtype: dict[str, str]
|
:rtype: dict[str, str]
|
||||||
"""
|
"""
|
||||||
env = dict(
|
env = dict(
|
||||||
|
TOWER_VERSION=self.version,
|
||||||
TOWER_HOST=self.host,
|
TOWER_HOST=self.host,
|
||||||
TOWER_USERNAME=self.username,
|
TOWER_USERNAME=self.username,
|
||||||
TOWER_PASSWORD=self.password,
|
TOWER_PASSWORD=self.password,
|
||||||
|
@ -231,6 +232,11 @@ class TowerConfig(object):
|
||||||
values = dict((k, parser.get('general', k)) for k in keys)
|
values = dict((k, parser.get('general', k)) for k in keys)
|
||||||
config = TowerConfig(values)
|
config = TowerConfig(values)
|
||||||
|
|
||||||
|
missing = [k for k in keys if not values.get(k)]
|
||||||
|
|
||||||
|
if missing:
|
||||||
|
raise ApplicationError('Missing or empty Tower configuration value(s): %s' % ', '.join(missing))
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue