Skip to content

Commit

Permalink
Merge pull request #14254 from bzwei/dialog_id_in_options
Browse files Browse the repository at this point in the history
Save newly created dialog_id in options
  • Loading branch information
gmcculloug authored Mar 10, 2017
2 parents 150dc58 + 192045c commit 1032e7b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/models/service_template_ansible_playbook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ def self.create_catalog_item(options, auth_user)
next unless dialog_name

job_template = enhanced_config.fetch_path(action, :configuration_template)
enhanced_config[action][:dialog] =
Dialog::AnsiblePlaybookServiceDialog.create_dialog(dialog_name, job_template)
new_dialog = Dialog::AnsiblePlaybookServiceDialog.create_dialog(dialog_name, job_template)
enhanced_config[action][:dialog] = new_dialog
service_template.options[:config_info][action][:dialog_id] = new_dialog.id
end
service_template.create_resource_actions(enhanced_config)
end
Expand Down
3 changes: 3 additions & 0 deletions spec/models/service_template_ansible_playbook_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@
:fqname => described_class.default_provisioning_entry_point('atomic'),
:configuration_template => job_template
)

saved_options = catalog_item_options_two[:config_info].deep_merge(:provision => {:dialog_id => service_template.dialogs.first.id})
expect(service_template.options[:config_info]).to include(saved_options)
end
end
end

0 comments on commit 1032e7b

Please sign in to comment.