Skip to content

Commit

Permalink
config_info should not contain key :configuration_template
Browse files Browse the repository at this point in the history
  • Loading branch information
bzwei committed May 4, 2017
1 parent dcece3e commit ceefbbe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/models/service_template_ansible_playbook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,15 @@ def validate_update_config_info(options)
opts = super
self.class.send(:validate_config_info, opts)
end

# override
def update_service_resources(_config_info, _auth_user = nil)
# do nothing since no service resources for this template
end

# override
def update_from_options(params)
options[:config_info] = Hash[params[:config_info].collect { |k, v| [k, v.except(:configuration_template)] }]
update_attributes!(params.except(:config_info))
end
end
1 change: 1 addition & 0 deletions spec/models/service_template_ansible_playbook_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@
new_dialog_record = Dialog.where(:label => new_dialog_label).first
expect(new_dialog_record).to be_truthy
expect(service_template.resource_actions.first.dialog.id).to eq new_dialog_record.id
expect(service_template.options[:config_info][:provision]).not_to have_key(:configuration_template)
end

it 'uses the existing dialog if :dialog_id is passed in' do
Expand Down

0 comments on commit ceefbbe

Please sign in to comment.