From fe94ea978faf06c82dd6c633cefa4fbeb3fbf102 Mon Sep 17 00:00:00 2001 From: Bill Wei Date: Thu, 27 Apr 2017 15:00:20 -0400 Subject: [PATCH] Fix a bug that attributes are hidden by local variables --- app/models/service_template_ansible_playbook.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/service_template_ansible_playbook.rb b/app/models/service_template_ansible_playbook.rb index 9ad8c9844ac..ad45d40ae73 100644 --- a/app/models/service_template_ansible_playbook.rb +++ b/app/models/service_template_ansible_playbook.rb @@ -100,11 +100,12 @@ def self.build_parameter_list(name, description, info) :project => playbook.configuration_script_source.manager_ref, :playbook => playbook.name, :inventory => tower.provider.default_inventory, + :become_enabled => info[:become_enabled].present?, :ask_variables_on_launch => true, :ask_limit_on_launch => true, :ask_inventory_on_launch => true, :ask_credential_on_launch => true - }.merge(info.slice(:become_enabled)) + } if info[:extra_vars] params[:extra_vars] = info[:extra_vars].transform_values do |val| val.kind_of?(String) ? val : val[:default] # TODO: support Hash only @@ -144,8 +145,8 @@ def job_template(action) def update_catalog_item(options, auth_user = nil) config_info = validate_update_config_info(options) - name = options[:name] || name - description = options[:description] || description + name = options[:name] || self.name + description = options[:description] || self.description update_job_templates(name, description, config_info, auth_user)