mirror of
https://github.com/ansible/ansible.git
synced 2026-08-03 08:03:05 +02:00
Fix traceback and allow installing roles with version None (#81849)
* Allow installing roles with version `None` from Galaxy Co-authored-by: Matt Martz <matt@sivel.net>
This commit is contained in:
co-authored by
Matt Martz
parent
4000656849
commit
7adc146e2f
@@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- ansible-galaxy role install - fix installing roles from Galaxy that have version ``None`` (https://github.com/ansible/ansible/issues/81832).
|
||||
@@ -297,7 +297,7 @@ class GalaxyRole(object):
|
||||
# are no versions in the list, we'll grab the head
|
||||
# of the master branch
|
||||
if len(role_versions) > 0:
|
||||
loose_versions = [LooseVersion(a.get('name', None)) for a in role_versions]
|
||||
loose_versions = [v for a in role_versions if (v := LooseVersion()) and v.parse(a.get('name') or '') is None]
|
||||
try:
|
||||
loose_versions.sort()
|
||||
except TypeError:
|
||||
|
||||
Reference in New Issue
Block a user