Improve Tower integration test support:

- Add TOWER_VERSION environment variable.
- Add error check for missing configuration.
This commit is contained in:
Matt Clay 2018-03-15 11:52:56 -07:00
parent 70c0875dbc
commit 981e89117a

View file

@ -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