Bug 1369737
Summary: | API template_combinations GET and DELETE by id not working | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Peter Vreman <peter.vreman> |
Component: | API | Assignee: | Shimon Shtein <sshtein> |
Status: | CLOSED ERRATA | QA Contact: | Renzo Nuccitelli <rnuccite> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 6.2.0 | CC: | bbuckingham, bkearney, brubisch, jcallaha, rnuccite |
Target Milestone: | Unspecified | Keywords: | Triaged |
Target Release: | Unused | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-02-21 16:51:07 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1122832 |
Description
Peter Vreman
2016-08-24 09:27:46 UTC
Patch to make the API consistent that also DELETE and GET will only work on combinations with the environment or hostgroup [crash] root@li-lc-1578:/usr/share/foreman# diff -u /usr/share/foreman/config/routes/api/v2.rb.160831-1 /usr/share/foreman/config/routes/api/v2.rb --- /usr/share/foreman/config/routes/api/v2.rb.160831-1 2016-08-09 22:10:52.000000000 +0000 +++ /usr/share/foreman/config/routes/api/v2.rb 2016-08-31 13:47:35.776275554 +0000 @@ -32,7 +32,7 @@ get 'build_pxe_default' # Keeping get variant for backward compatibility, see #6976 for details get 'revision' end - resources :template_combinations, :only => [:index, :create, :update, :show] + resources :template_combinations, :only => [:index, :create, :update, :show, :destroy] resources :operatingsystems, :except => [:new, :edit] resources :os_default_templates, :except => [:new, :edit] end @@ -44,7 +44,7 @@ post 'build_pxe_default' get 'revision' end - resources :template_combinations, :only => [:index, :create, :update, :show] + resources :template_combinations, :only => [:index, :create, :update, :show, :destroy] resources :operatingsystems, :except => [:new, :edit] resources :os_default_templates, :except => [:new, :edit] end @@ -66,7 +66,7 @@ end end resources :hosts, :except => [:new, :edit] - resources :template_combinations, :only => [:index, :show, :create, :update] + resources :template_combinations, :only => [:index, :create, :update, :show, :destroy] end resources :fact_values, :only => [:index] @@ -89,7 +89,7 @@ resources :puppetclasses, :except => [:new, :edit] resources :hostgroup_classes, :path => :puppetclass_ids, :only => [:index, :create, :destroy] resources :hosts, :except => [:new, :edit] - resources :template_combinations, :only => [:show, :index, :create, :update] + resources :template_combinations, :only => [:index, :create, :update, :show, :destroy] end resources :media, :except => [:new, :edit] do @@ -228,7 +228,6 @@ resources :template_kinds, :only => [:index] - resources :template_combinations, :only => [:show, :destroy] resources :config_groups, :except => [:new, :edit] resources :compute_attributes, :only => [:create, :update] [crash] root@li-lc-1578:/usr/share/foreman# diff -u /usr/share/foreman/app/controllers/api/v2/template_combinations_controller.rb.160831-1 /usr/share/foreman/app/controllers/api/v2/template_combinations_controller.rb --- /usr/share/foreman/app/controllers/api/v2/template_combinations_controller.rb.160831-1 2016-08-09 22:10:52.000000000 +0000 +++ /usr/share/foreman/app/controllers/api/v2/template_combinations_controller.rb 2016-08-31 13:36:02.841309152 +0000 @@ -41,7 +41,6 @@ process_response @template_combination.save end - api :GET, "/template_combinations/:id", N_("Show template combination") api :GET, "/config_templates/:config_template_id/template_combinations/:id", N_("Show template combination"), :deprecated => true api :GET, "/provisioning_templates/:provisioning_template_id/template_combinations/:id", N_("Show template combination") api :GET, "/hostgroups/:hostgroup_id/template_combinations/:id", N_("Show template combination") @@ -63,8 +62,13 @@ process_response @template_combination.update_attributes!(params[:template_combination]) end - api :DELETE, "/template_combinations/:id", N_("Delete a template combination") + api :DELETE, "/config_templates/:config_template_id/template_combinations/:id", N_("Delete template combination"), :deprecated => true + api :DELETE, "/provisioning_templates/:provisioning_template_id/template_combinations/:id", N_("Delete template combination") + api :DELETE, "/hostgroups/:hostgroup_id/template_combinations/:id", N_("Delete template combination") + api :DELETE, "/environments/:environment_id/template_combinations/:id", N_("Delete template combination") param :id, :identifier, :required => true + param_group :template_combination_identifiers + param_group :template_combination def destroy process_response @template_combination.destroy Created redmine issue http://projects.theforeman.org/issues/16397 from this bug Upstream bug assigned to sshtein Upstream bug assigned to sshtein Upstream bug component is API Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16397 has been resolved. Bug fixed on 6.3. Added automation issue to avoid regressions on future: https://github.com/SatelliteQE/robottelo/issues/3961. Moving to verified. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
>
> For information on the advisory, and where to find the updated files, follow the link below.
>
> If the solution does not work for you, open a new bug report.
>
> https://access.redhat.com/errata/RHSA-2018:0336
|