mirror of
https://github.com/ansible/awx.git
synced 2026-02-28 08:18:43 -03:30
Loosen Collections v Tower version check
This commit is contained in:
@@ -7,6 +7,7 @@ from ansible.module_utils.urls import Request, SSLValidationError, ConnectionErr
|
|||||||
from ansible.module_utils.six import PY2
|
from ansible.module_utils.six import PY2
|
||||||
from ansible.module_utils.six.moves.urllib.error import HTTPError
|
from ansible.module_utils.six.moves.urllib.error import HTTPError
|
||||||
from ansible.module_utils.six.moves.http_cookiejar import CookieJar
|
from ansible.module_utils.six.moves.http_cookiejar import CookieJar
|
||||||
|
import semver
|
||||||
import time
|
import time
|
||||||
from json import loads, dumps
|
from json import loads, dumps
|
||||||
|
|
||||||
@@ -259,10 +260,17 @@ class TowerAPIModule(TowerModule):
|
|||||||
tower_type = response.info().getheader('X-API-Product-Name', None)
|
tower_type = response.info().getheader('X-API-Product-Name', None)
|
||||||
tower_version = response.info().getheader('X-API-Product-Version', None)
|
tower_version = response.info().getheader('X-API-Product-Version', None)
|
||||||
|
|
||||||
|
semver_collection_version = semver.VersionInfo.parse(self._COLLECTION_VERSION)
|
||||||
|
semver_tower_version = semver.VersionInfo.parse(tower_version)
|
||||||
|
|
||||||
if self._COLLECTION_TYPE not in self.collection_to_version or self.collection_to_version[self._COLLECTION_TYPE] != tower_type:
|
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))
|
self.warn("You are using the {0} version of this collection but connecting to {1}".format(
|
||||||
elif self._COLLECTION_VERSION != tower_version:
|
self._COLLECTION_TYPE, tower_type
|
||||||
self.warn("You are running collection version {0} but connecting to tower version {1}".format(self._COLLECTION_VERSION, tower_version))
|
))
|
||||||
|
elif semver_collection_version.major != semver_tower_version.major:
|
||||||
|
self.warn("You are running collection version {0} but connecting to tower version {1}".format(
|
||||||
|
self._COLLECTION_VERSION, tower_version
|
||||||
|
))
|
||||||
self.version_checked = True
|
self.version_checked = True
|
||||||
|
|
||||||
response_body = ''
|
response_body = ''
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ python3-saml
|
|||||||
python-ldap>=3.3.1 # https://github.com/python-ldap/python-ldap/issues/270
|
python-ldap>=3.3.1 # https://github.com/python-ldap/python-ldap/issues/270
|
||||||
pyyaml>=5.4.1 # minimum to fix https://github.com/yaml/pyyaml/issues/478
|
pyyaml>=5.4.1 # minimum to fix https://github.com/yaml/pyyaml/issues/478
|
||||||
schedule==0.6.0
|
schedule==0.6.0
|
||||||
|
semver==2.13.0
|
||||||
social-auth-core==3.3.1 # see UPGRADE BLOCKERs
|
social-auth-core==3.3.1 # see UPGRADE BLOCKERs
|
||||||
social-auth-app-django==3.1.0 # see UPGRADE BLOCKERs
|
social-auth-app-django==3.1.0 # see UPGRADE BLOCKERs
|
||||||
redis
|
redis
|
||||||
|
|||||||
Reference in New Issue
Block a user