Actions
Bug #1563
closedproblem cloning host in latest develop
Description
Host cloning does not appear to be working for me.
- I have a host defined with FQDN, HG, environment, puppetmaster, one class and one parameter.
- I click "clone". The initial "Clone Host" page loads (/hosts/hostname/clone). The Name field is highlighted in red and says "already taken". The yellow warning popup in the upper right corner says "The following fields need reviewing" (and nothing more). The items on the Puppet Classes and Additional Information tabs look fine. The Parameters tab is OK, but is showing raw HTML in place of the host_host_parameters_attributes_0_name input field and its label.
- When I click "Submit", I just get the page spit back to me with the following in production.log:
Started POST "/hosts" for 10.13.6.244 at Fri Mar 30 16:23:57 -0400 2012 Processing by HostsController#create as HTML Parameters: {"host"=>{"puppet_proxy_id"=>"1", "enabled"=>"1", "hostgroup_id"=>"1", "name"=>"jantmanvm2.eng.domain.com", "host_parameters_attributes"=>{"0"=>{"nested"=>"", "_destroy"=>"false", "value"=>"[FILTERED]"}}, "overwrite"=>"false", "model_id"=>"1", "comment"=>"test for foreman UI", "compute_resource_id"=>"", "managed"=>"1", "is_owned_by"=>"1-Users", "environment_id"=>"5", "puppetclass_ids"=>["", "121"]}, "authenticity_token"=>"asdfghjklasdfghjkl=", "utf8"=>"✓", "commit"=>"Submit"} Failed to save: Host parameters name can't be blank, Host parameters name can't be blank or contain trailing white space, Name has already been taken Rendered puppetclasses/_selectedClasses.html.erb (0.7ms) Rendered puppetclasses/_classes.html.erb (151.0ms) Rendered puppetclasses/_class_selection.html.erb (155.7ms) Rendered common_parameters/_parameter.erb (4.1ms) Rendered common_parameters/_parameter.erb (3.9ms) Rendered common_parameters/_parameters.erb (9.9ms) Rendered hosts/_form.html.erb (277.3ms) Rendered bookmarks/_list.html.erb (1.8ms) Rendered bookmarks/_list.html.erb (0.5ms) Rendered home/_settings.html.erb (4.3ms) Rendered home/_user_dropdown.rhtml (0.9ms) Rendered home/_topbar.rhtml (15.2ms) Rendered hosts/new.html.erb within layouts/application (297.8ms) Completed 200 OK in 335ms (Views: 295.5ms | ActiveRecord: 9.0ms)
Updated by Jason Antman over 12 years ago
The name parameter shown above, "jantmanvm2.eng.domain.com", is the host I am cloning from, not to. I think the first issue here is that when a host is cloned, it should probably initialize the form with a blank hostname.
Hitting "submit" again after verifying that the name is what I want it to be (jantmanvm8.eng.domain.com), I now have no red-highlighted fields, I just get the same form with the same contents spit back to me over and over, with no errors or warnings in the UI. In production.log, I see:
Started POST "/hosts" for 10.13.6.244 at Fri Mar 30 16:55:32 -0400 2012 Processing by HostsController#create as HTML Parameters: {"host"=>{"puppet_proxy_id"=>"1", "enabled"=>"1", "hostgroup_id"=>"1", "name"=>"jantmanvm8.eng.domain.com", "host_parameters_attributes"=>{"0"=>{"nested"=>"", "_destroy"=>"false", "value"=>"[FILTERED]"}}, "overwrite"=>"false", "model_id"=>"1", "comment"=>"test for foreman UI", "compute_resource_id"=>"", "managed"=>"true", "is_owned_by"=>"1-Users", "environment_id"=>"5", "puppetclass_ids"=>["", "121"]}, "authenticity_token"=>"objergheruihgigj=", "utf8"=>"✓", "commit"=>"Submit"} Failed to save: Host parameters name can't be blank, Host parameters name can't be blank or contain trailing white space Rendered puppetclasses/_selectedClasses.html.erb (0.8ms) Rendered puppetclasses/_classes.html.erb (157.6ms) Rendered puppetclasses/_class_selection.html.erb (163.2ms) Rendered common_parameters/_parameter.erb (4.1ms) Rendered common_parameters/_parameter.erb (3.7ms) Rendered common_parameters/_parameters.erb (9.8ms) Rendered hosts/_form.html.erb (284.8ms) Rendered bookmarks/_list.html.erb (1.6ms) Rendered bookmarks/_list.html.erb (0.4ms) Rendered home/_settings.html.erb (3.9ms) Rendered home/_user_dropdown.rhtml (1.0ms) Rendered home/_topbar.rhtml (13.6ms) Rendered hosts/new.html.erb within layouts/application (303.9ms) Completed 200 OK in 332ms (Views: 301.6ms | ActiveRecord: 5.2ms)
(BTW, I'm manually obscuring the authenticity token in these)
Updated by Ohad Levy over 12 years ago
- Assignee set to Amos Benari
- Target version set to 1.0
Updated by Amos Benari over 12 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
Applied in changeset ae98767dafb821202913c7ecdb77b72c7efbbdc2.
Actions