Project

General

Profile

Actions

Bug #10215

closed

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

Added by Dominic Cleal over 9 years ago. Updated over 6 years ago.

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

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

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

Updated by Dominic Cleal over 9 years ago

  • Translation missing: en.field_release set to 28

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

Actions #4

Updated by Dominic Cleal over 9 years ago

  • Status changed from New to Assigned
  • Assignee set to Dominic Cleal
Actions #5

Updated by Dominic Cleal over 9 years ago

  • Assignee changed from Dominic Cleal to Martin Bacovsky
Actions #6

Updated by The Foreman Bot over 9 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 ()
Actions #7

Updated by Anonymous over 9 years ago

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

Also available in: Atom PDF