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]
|
||||
"""
|
||||
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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue