Actions
Bug #10215
closedPuppet classes and proxies reset to empty values on any host update
Status:
Closed
Priority:
High
Assignee:
Category:
Foreman commands (obsolete)
Target version:
Difficulty:
Triaged:
Team Backlog:
Description
When making any update on a host with Hammer, a nil puppetclass_ids
is passed to the API and so the list of assigned Puppet classes is reset, causing per-host configuration to be lost.
[root@foreman ~]# hammer host puppet-classes --host $(hostname) ---|----- ID | NAME ---|----- 2 | ntp ---|----- [root@foreman ~]# hammer host update --name $(hostname) --comment test Host updated [root@foreman ~]# hammer host puppet-classes --host $(hostname) ---|----- ID | NAME ---|-----
Started PUT "/api/hosts/1" for 127.0.0.1 at 2015-04-21 08:33:16 +0000 2015-04-21 08:33:16 [I] Processing by Api::V2::HostsController#update as JSON 2015-04-21 08:33:16 [I] Parameters: {"host"=>{"name"=>"foreman.example.com", "comment"=>"test", "compute_attributes"=>{"volumes_attributes"=>{}}, "owner_id"=>nil, "puppet_proxy_id"=>nil, "puppet_ca_proxy_id"=>nil, "puppetclass_ids"=>nil, "host_parameters_attributes"=>{}, "interfaces_attributes"=>{}}, "apiv"=>"v2", "id"=>"1"} 2015-04-21 08:33:16 [I] Authorized user admin(Admin User) 2015-04-21 08:33:16 [I] Rendered api/v2/hosts/update.json.rabl (114.6ms) 2015-04-21 08:33:16 [I] Completed 200 OK in 292ms (Views: 112.0ms | ActiveRecord: 49.9ms)
Same happens for the Puppet proxies:
[root@foreman ~]# hammer host info --name $(hostname) | grep -i puppet Puppet CA Proxy Id: 1 Puppet Proxy Id: 1 [root@foreman ~]# hammer host update --name $(hostname) --comment test3 Host updated [root@foreman ~]# hammer host info --name $(hostname) | grep -i puppet Puppet CA Proxy Id: Puppet Proxy Id:
The above reproducer was on nightlies:
foreman-1.9.0-0.develop.201504080732gitcbe8aa6.el7.noarch
rubygem-hammer_cli-0.1.4-1.201503311239gitf695cfa.el7.noarch
rubygem-hammer_cli_foreman-0.1.4-1.201503240905git7377f48.el7.noarch
Originally observed on 1.8.0-RC2 with Hammer 0.1.4.
Files
Actions