Actions
Bug #12263
openapi 1.9 hostgroups update to :organization_names => ['local'] sets location, not organization when there are organizations and locations with the same name
Status:
New
Priority:
Normal
Assignee:
-
Category:
Organizations and Locations
Target version:
-
Description
When writing the provider / type for foreman_hostgroup (https://github.com/theforeman/puppet-foreman/pull/366), I discovered that calling an api create or update on a hostgroup, if there is an org and a location with the same name, setting organization_names sets the locations, not the organization.
[148] pry(main)> api.resource(:hostgroups).call(:show, id: 10)["locations"] => [] [149] pry(main)> api.resource(:hostgroups).call(:show, id: 10)["organizations"] => [] [150] pry(main)> api.resource(:hostgroups).call(:update, {:id => 10, :hostgroup => { :organization_names => ["local"] }}) => {"ancestry"=>"5", "architecture_id"=>nil, "compute_profile_id"=>nil, "created_at"=>"2015-10-22T13:27:40Z", "domain_id"=>nil, "environment_id"=>1, "grub_pass"=>"", "id"=>10, "image_file"=>"", "medium_id"=>nil, "name"=>"test9", "operatingsystem_id"=>nil, "ptable_id"=>nil, "puppet_ca_proxy_id"=>1, "puppet_proxy_id"=>1, "realm_id"=>nil, "root_pass"=>nil, "subnet_id"=>nil, "title"=>"test4/test9", "updated_at"=>"2015-10-22T13:27:40Z", "use_image"=>nil, "vm_defaults"=>nil} [151] pry(main)> api.resource(:hostgroups).call(:show, id: 10)["locations"] => [{"id"=>1, "name"=>"local", "title"=>"local"}] [152] pry(main)> api.resource(:hostgroups).call(:show, id: 10)["organizations"] => []
Updated by Dominic Cleal over 8 years ago
- Category set to Organizations and Locations
Actions