Skip to content

Commit

Permalink
Fix a bug that attributes are hidden by local variables
Browse files Browse the repository at this point in the history
  • Loading branch information
bzwei committed Apr 28, 2017
1 parent 3bbbaaf commit fe94ea9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/models/service_template_ansible_playbook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit fe94ea9

Please sign in to comment.