Actions
Bug #21771
closedsalt_keys api using wrong variable name for updates
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Description
the salt_keys api currently is referencing a variable in the updated definition that is not being filled up so the request will fail with below error:
2017-11-27T09:02:28 1f1c2ec8 [app] [I] Started PUT "/salt/api/v2/salt_keys/my-smart-proxy/my-test-server" for 10.0.X.X at 2017-11-27 09:02:28 +0100 2017-11-27T09:02:28 1f1c2ec8 [app] [I] Processing by ForemanSalt::Api::V2::SaltKeysController#update as JSON 2017-11-27T09:02:28 1f1c2ec8 [app] [I] Parameters: {"state"=>"rejected", "apiv"=>"v2", "smart_proxy_id"=>"my-smart-proxy", "name"=>"my-test-server", "salt_key"=>{"state"=>"rejected"}} 2017-11-27T09:02:28 1f1c2ec8 [app] [I] Current user: mypersonaluser (regular user) 2017-11-27T09:02:28 1f1c2ec8 [app] [W] Action failed | NoMethodError: undefined method `[]' for nil:NilClass | /usr/share/foreman/vendor/ruby/2.0.0/gems/foreman_salt-8.0.2/app/controllers/foreman_salt/api/v2/salt_keys_controller.rb:24:in `update'
I found out that line 24 is referencing
case params[:key][:state]
while it should be params[:salt_key][:state]
Updated by The Foreman Bot over 6 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman_salt/pull/74 added
Updated by Anonymous over 6 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset foreman_salt|e8dab198bf227f36123e9afb6e441988a70d29e7.
Actions