Project

General

Profile

Bug #10215

Puppet classes and proxies reset to empty values on any host update

Added by Dominic Cleal almost 4 years ago. Updated 8 months ago.

Status:
Closed
Priority:
High
Category:
Foreman commands (obsolete)
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

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.

hammer_10215.log hammer_10215.log 14.8 KB debug log Dominic Cleal, 04/21/2015 04:46 AM

Associated revisions

Revision cc220a18 (diff)
Added by Martin Bačovský almost 4 years ago

Fixes #10215 - host update resets some attributes

Revision ad0190c3
Added by mbacovsky almost 4 years ago

Merge pull request #176 from mbacovsky/10215_host_update_reset

Fixes #10215 - host update resets some attributes

History

#2 Updated by Dominic Cleal almost 4 years ago

  • Legacy Backlogs Release (now unused) set to 28

Not present in Hammer 0.1.3, so it's a 1.7 to 1.8 regression.

#4 Updated by Dominic Cleal almost 4 years ago

  • Status changed from New to Assigned
  • Assignee set to Dominic Cleal

#5 Updated by Dominic Cleal almost 4 years ago

  • Assignee changed from Dominic Cleal to Martin Bacovsky

#6 Updated by The Foreman Bot almost 4 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/hammer-cli-foreman/pull/176 added
  • Pull request deleted ()

#7 Updated by Anonymous almost 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF