Fixing version check

This commit is contained in:
John Westcott IV
2021-03-25 09:33:46 -04:00
committed by beeankha
parent aa9906ebae
commit 75a99bb1d5
2 changed files with 11 additions and 5 deletions

View File

@@ -262,14 +262,13 @@ class TowerAPIModule(TowerModule):
parsed_collection_version = Version(self._COLLECTION_VERSION).version
parsed_tower_version = Version(tower_version).version
if tower_type != 'AWX':
if tower_type == 'AWX':
collection_compare_ver = parsed_collection_version[0]
tower_compare_ver = parsed_tower_version[0]
else:
collection_compare_ver = "{}.{}".format(parsed_collection_version[0], parsed_collection_version[1])
tower_compare_ver = '{}.{}'.format(parsed_tower_version[0], parsed_tower_version[1])
if self._COLLECTION_TYPE not in self.collection_to_version or self.collection_to_version[self._COLLECTION_TYPE] != tower_type:
self.warn("You are using the {0} version of this collection but connecting to {1}".format(self._COLLECTION_TYPE, tower_type))
elif collection_compare_ver != tower_compare_ver: