Project

General

Profile

Actions

Bug #9815

closed

HostGroup Clone doesn't work if the hostgroup has parameters

Added by Tommy McNeely about 9 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Host groups
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

I ran into an issue trying to clone a HostGroup in Foreman 1.7.3. it goes to a 404 page. Here is a demo video: https://docs.google.com/a/lark-it.com/file/d/0Bw8r1SqN6Yt_TGVDa0YxQkFGY3c/edit?usp=drivesdk

It seems to only affect hostgroups that have parameters. I am able to clone hostgroups that do not have any parameters, even if they are nested several levels deep, with parent parameters.

Here is the difference between a "create" operation and a "clone" operation in logs:

  • Create {code}
    Started POST "/hostgroups" for 67.176.44.123 at 2015-03-18 12:55:11 -0400
    Processing by HostgroupsController#create as HTML
    Parameters: {"utf8"=>"✓", "authenticity_token"=>"(redacted)", "hostgroup"=>{"parent_id"=>"", "name"=>"CloneMe", "environment_id"=>"2", "compute_profile_id"=>"1", "puppet_ca_proxy_id"=>"1", "puppet_proxy_id"=>"1", "puppetclass_ids"=>[""], "domain_id"=>"2", "realm_id"=>"1", "architecture_id"=>"1", "operatingsystem_id"=>"1", "medium_id"=>"1", "ptable_id"=>"7", "root_pass"=>"[FILTERED]", "group_parameters_attributes"=>{"1426697695990"=>{"name"=>"MyParameter", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false", "nested"=>""}}, "organization_ids"=>[""], "id"=>""}, "commit"=>"Submit"}
    Redirected to https://foreman.lark-it.com/hostgroups
    Completed 302 Found in 174ms (ActiveRecord: 34.6ms) {code}

*Clone {code}
Started POST "/hostgroups" for 67.176.44.123 at 2015-03-18 12:55:45 -0400
Processing by HostgroupsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"(redacted)", "hostgroup"=>{"parent_id"=>"", "name"=>"ClonedGroup", "environment_id"=>"2", "compute_profile_id"=>"1", "puppet_ca_proxy_id"=>"1", "puppet_proxy_id"=>"1", "puppetclass_ids"=>[""], "domain_id"=>"2", "realm_id"=>"1", "architecture_id"=>"1", "operatingsystem_id"=>"1", "medium_id"=>"1", "ptable_id"=>"7", "root_pass"=>"[FILTERED]", "group_parameters_attributes"=>{"0"=>{"name"=>"MyParameter", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false", "nested"=>"", "id"=>"22"}}, "organization_ids"=>[""], "id"=>""}, "commit"=>"Submit"}
Rendered common/404.html.erb within layouts/application (3.3ms)
Rendered layouts/base.html.erb (3.4ms)
Completed 404 Not Found in 53ms (Views: 10.7ms | ActiveRecord: 5.6ms) {code}

The difference appears to be: {code}
"group_parameters_attributes"=>{"0"=>{"name"=>"MyParameter", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false", "nested"=>"", "id"=>"22"}} {code}

Hope this helps ;)


Related issues 5 (0 open5 closed)

Related to Foreman - Bug #8521: Host clone should include associated Puppet classesClosedDominic Cleal11/26/2014Actions
Related to Foreman - Bug #9820: API: Hostgroup Clone does not clone parametersClosedTommy McNeely03/18/2015Actions
Related to Foreman - Bug #12566: New Host API changed host_parameters_attributes behaviorClosedLukas Zapletal11/23/2015Actions
Has duplicate Foreman - Bug #11218: Cloning hostgroup containing (a/any) parameter failsDuplicate07/27/2015Actions
Has duplicate Foreman - Bug #11404: UI throws 'Host group Not Found' on cloning a existing hostgroupDuplicateShimon Shtein08/18/2015Actions
Actions

Also available in: Atom PDF