1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Cast input role version to string before comparing to available versions (#18269)

* Cast input role version to string before comparing to avaialble versions

Fixes #10262
This commit is contained in:
jctanner 2016-10-31 21:07:38 -04:00 committed by GitHub
parent e753860cb2
commit b494d55bde

View file

@ -237,7 +237,7 @@ class GalaxyRole(object):
else:
self.version = 'master'
elif self.version != 'master':
if role_versions and self.version not in [a.get('name', None) for a in role_versions]:
if role_versions and str(self.version) not in [a.get('name', None) for a in role_versions]:
raise AnsibleError("- the specified version (%s) of %s was not found in the list of available versions (%s)." % (self.version, self.name, role_versions))
tmp_file = self.fetch(role_data)