Remove platforms api request from galaxy 'init'

Instead of populating the platform comment in the default
meta/main.yml with a dict of platforms fetch from the
galaxy REST API, this removes the API call and adds a
commented out example platforms list to the default meta/main.yml

Fixes #18103
This commit is contained in:
Adrian Likins 2016-11-16 16:49:11 -05:00 committed by Brian Coca
parent b67f50570e
commit 1e08e9a55f
2 changed files with 12 additions and 25 deletions

View file

@ -192,18 +192,6 @@ class GalaxyCLI(CLI):
"however it will reset any main.yml files that may have\n" "however it will reset any main.yml files that may have\n"
"been modified there already." % role_path) "been modified there already." % role_path)
platforms = []
if not offline:
platforms = self.api.get_list("platforms") or []
# group the list of platforms from the api based
# on their names, with the release field being
# appended to a list of versions
platform_groups = defaultdict(list)
for platform in platforms:
platform_groups[platform['name']].append(platform['release'])
platform_groups[platform['name']].sort()
inject_data = dict( inject_data = dict(
role_name=role_name, role_name=role_name,
author='your name', author='your name',
@ -212,7 +200,6 @@ class GalaxyCLI(CLI):
license='license (GPLv2, CC-BY, etc)', license='license (GPLv2, CC-BY, etc)',
issue_tracker_url='http://example.com/issue/tracker', issue_tracker_url='http://example.com/issue/tracker',
min_ansible_version='1.2', min_ansible_version='1.2',
platforms=platform_groups,
container_enabled=self.options.container_enabled container_enabled=self.options.container_enabled
) )

View file

@ -30,19 +30,19 @@ galaxy_info:
#github_branch: #github_branch:
# #
# Below are all platforms currently available. Just uncomment the ones that apply # platforms is a list of platforms, and each platform has a name and a list of versions.
# to your role. If you don't see your platform on this list, let us know,
# and we'll get it added!
# #
# platforms: # platforms:
{%- for platform,versions in platforms.items() %} # - name: Fedora
#- name: {{ platform }}
# versions: # versions:
# - all # - all
{%- for version in versions %} # - 25
# - {{ version }} # - name: SomePlatform
{%- endfor -%} # versions:
{%- endfor %} # - all
# - 1.0
# - 7
# - 99.99
galaxy_tags: [] galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes # List tags for your role here, one per line. A tag is a keyword that describes