From 981e89117aa6a2ca12685f37ba0cb84f92c41e48 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Thu, 15 Mar 2018 11:52:56 -0700 Subject: [PATCH] Improve Tower integration test support: - Add TOWER_VERSION environment variable. - Add error check for missing configuration. --- test/runner/lib/cloud/tower.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/runner/lib/cloud/tower.py b/test/runner/lib/cloud/tower.py index ac64d725f7..7d4acf5d14 100644 --- a/test/runner/lib/cloud/tower.py +++ b/test/runner/lib/cloud/tower.py @@ -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