mirror of
https://github.com/ansible/awx.git
synced 2026-02-01 17:48:10 -03:30
Splitting out AWX and Tower versions
This commit is contained in:
committed by
beeankha
parent
e2b290ff99
commit
bb43ecb0b5
@@ -260,13 +260,21 @@ class TowerAPIModule(TowerModule):
|
||||
tower_type = response.info().getheader('X-API-Product-Name', None)
|
||||
tower_version = response.info().getheader('X-API-Product-Version', None)
|
||||
|
||||
collection_major = Version(self._COLLECTION_VERSION).version[0]
|
||||
tower_major = Version(tower_version).version[0]
|
||||
parsed_collection_version = Version(self._COLLECTION_VERSION).version
|
||||
parsed_tower_version = Version(tower_version).version
|
||||
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_major = '{}.{}'.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_major != tower_major:
|
||||
elif collection_compare_ver != tower_compare_ver:
|
||||
self.warn("You are running collection version {0} but connecting to tower version {1}".format(self._COLLECTION_VERSION, tower_version))
|
||||
|
||||
self.version_checked = True
|
||||
|
||||
response_body = ''
|
||||
|
||||
Reference in New Issue
Block a user