mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-03 09:13:12 +00:00
Improve Tower integration test support:
- Add TOWER_VERSION environment variable. - Add error check for missing configuration.
This commit is contained in:
@@ -205,6 +205,7 @@ class TowerConfig(object):
|
||||
:rtype: dict[str, str]
|
||||
"""
|
||||
env = dict(
|
||||
TOWER_VERSION=self.version,
|
||||
TOWER_HOST=self.host,
|
||||
TOWER_USERNAME=self.username,
|
||||
TOWER_PASSWORD=self.password,
|
||||
@@ -231,6 +232,11 @@ class TowerConfig(object):
|
||||
values = dict((k, parser.get('general', k)) for k in keys)
|
||||
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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user