|
|
@ -608,8 +608,9 @@ class GalaxyCLI(CLI):
|
|
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
# Newer format with a collections and/or roles key
|
|
|
|
# Newer format with a collections and/or roles key
|
|
|
|
extra_keys = set(file_requirements.keys()).difference(set(['roles', 'collections']))
|
|
|
|
is_galaxy_yml = set(file_requirements.keys()).issuperset(['name', 'namespace'])
|
|
|
|
if extra_keys:
|
|
|
|
extra_keys = set(file_requirements.keys()).difference(['roles', 'collections'])
|
|
|
|
|
|
|
|
if extra_keys and not is_galaxy_yml:
|
|
|
|
raise AnsibleError("Expecting only 'roles' and/or 'collections' as base keys in the requirements "
|
|
|
|
raise AnsibleError("Expecting only 'roles' and/or 'collections' as base keys in the requirements "
|
|
|
|
"file. Found: %s" % (to_native(", ".join(extra_keys))))
|
|
|
|
"file. Found: %s" % (to_native(", ".join(extra_keys))))
|
|
|
|
|
|
|
|
|
|
|
@ -641,6 +642,10 @@ class GalaxyCLI(CLI):
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
requirements['collections'].append((collection_req, '*', None, None))
|
|
|
|
requirements['collections'].append((collection_req, '*', None, None))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if is_galaxy_yml:
|
|
|
|
|
|
|
|
for req_name, req_version in (file_requirements.get('dependencies') or {}).items():
|
|
|
|
|
|
|
|
requirements['collections'].append((req_name, req_version, None, None))
|
|
|
|
|
|
|
|
|
|
|
|
return requirements
|
|
|
|
return requirements
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|