Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ansible] Stop building deprecated facts modules in collections #2476

Merged
merged 3 commits into from
Oct 16, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions provider/ansible.rb
Original file line number Diff line number Diff line change
Expand Up @@ -290,15 +290,6 @@ def compile_datasource(data)
File.join(target_folder,
"plugins/modules/#{name}_info.py"),
self)

# Generate symlink for old `facts` modules.
return if version_added(data.object, :facts) >= '2.9'

deprecated_facts_path = File.join(target_folder,
"plugins/modules/_#{name}_facts.py")
return if File.exist?(deprecated_facts_path)

File.symlink "#{name}_info.py", deprecated_facts_path
end

def generate_objects(output_folder, types)
Expand Down
9 changes: 1 addition & 8 deletions templates/ansible/facts.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ DOCUMENTATION = '''
---
<%= ansible_style_yaml({
'module' => "#{module_name(object)}_info",
'description' => ["Gather info for GCP #{object.name}",
(version_added(object, :facts) < '2.9' ? "This module was called C(#{module_name(object)}_facts) before Ansible 2.9. The usage has not changed." : nil)
].compact,
'description' => ["Gather info for GCP #{object.name}"],
'short_description' => "Gather info for GCP #{object.name}",
'version_added' => version_added(object, :facts),
'author' => "Google Inc. (@googlecloudplatform)",
Expand Down Expand Up @@ -91,11 +89,6 @@ def main():
})), 12)
-%>
)
<% if version_added(object, :facts) < '2.9' -%>

if module._name == '<%= module_name(object) -%>_facts':
module.deprecate("The '<%= module_name(object) -%>_facts' module has been renamed to '<%= module_name(object) -%>_info'", version='2.13')
<% end -%>

if not module.params['scopes']:
module.params['scopes'] = <%= python_literal(object.__product.scopes) %>
Expand Down