Actions
Bug #22715
closedstates can't be added through API
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
API
Target version:
-
Description
When I try to add a state trough the salt-api I get an error:
"error": {"message":"ActiveModel::ForbiddenAttributesError"}
The problem is in the salt_minions_controller.rb file, because some parameters don't get passed and this can be fixed as follows:
--- salt_minions_controller.rb.orig 2018-02-28 10:55:57.000000000 +0100 +++ salt_minions_controller.rb 2018-02-28 10:56:20.000000000 +0100 @@ -29,7 +29,7 @@ param_group :minion def update params[:minion][:salt_module_ids] = params[:minion].delete(:salt_state_ids) if params[:minion] - process_response @salt_minion.update_attributes(params[:minion]) + process_response @salt_minion.update_attributes(params.require(:minion).permit(:salt_proxy_id, :salt_environment_id, :salt_module_ids => [])) end def controller_permission
Is this fix in the right place, or should it be moved to a different class? If it's in the right place I'll submit a pull request.
Updated by The Foreman Bot about 6 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman_salt/pull/76 added
Updated by Anonymous about 6 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset foreman_salt|0bc8374244b399c2bb41c160d124dc239ee5f9af.
Actions