Bug #1563

problem cloning host in latest develop

Added by Jason Antman about 1 year ago. Updated 11 months ago.

Status:Closed Start:03/30/2012
Priority:Normal Due date:
Assigned to:Amos Benari % Done:

100%

Category:Host creation
Target version:1.0
Backlog:No Difficulity:
Votes: 0

Description

Host cloning does not appear to be working for me.

  1. I have a host defined with FQDN, HG, environment, puppetmaster, one class and one parameter.
  2. 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.
  3. 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)
    

Associated revisions

Revision bbf34baea8e6e2857b3665884d20742ba0bf3521
Added by Amos Benari 11 months ago

fixes #1563 problem cloning host in latest develop

Revision ae98767dafb821202913c7ecdb77b72c7efbbdc2
Added by Amos Benari 11 months ago

fixes #1563 problem cloning host in latest develop

History

Updated by Jason Antman about 1 year 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 11 months ago

  • Assigned to set to Amos Benari
  • Target version set to 1.0

Updated by Amos Benari 11 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF