Skip to content

Commit

Permalink
Fixes #5555 - fix org update action's apipie param
Browse files Browse the repository at this point in the history
In the OrganizationController v2 update action, the param_group
resource contained hash named resource. This was not substituted
for organization. As a result hammer-cli-katello, through
api-bindings, was incorrectly expecting and passing resource instead
of organization to the update action. Subsequently no
organizations were being updated.

The param_group was redefined on the update action so that the param
hash could have the correct name, :organization.
  • Loading branch information
Dustin Tsang committed Jun 16, 2014
1 parent 238e297 commit 5dfda34
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/controllers/katello/api/v2/organizations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@ def show
end

api :PUT, '/organizations/:id', N_('Update organization')
param_group :resource, ::Api::V2::TaxonomiesController
# The organization param hash below is redefined from foreman's ::Api::V2::TaxonomiesController
# resource param_group instead of reusing the param_group :resource scoped from TaxonomiesController.
# This is because name substitutions of the param group's name from :resource to :organization are limited
# to the inclusion of a modules.
param :organization, Hash, :action_aware => true do
param :name, String, :required => true
end
param :description, String, :desc => N_("description")
param :redhat_repository_url, String, :desc => N_("Redhat CDN url")
def update
Expand Down

0 comments on commit 5dfda34

Please sign in to comment.