Project

General

Profile

Bug #36167

Updated by Antonin Dvorak almost 2 years ago

*Description:* 

 When I update hostgroup-title, environment gets wiped out. Without modifying the hostgroup-title the update behaves as expected. 

 *How reproducible:* 
 Consistently 

 *Steps to Reproduce:* 

 <pre> 
 hammer host update --name hostXX.domainYY --build yes --operatingsystem "RHEL 8.7" --medium "RHEL Generic" --hostgroup-title "aaa/bbb/ccc" 
 </pre>  

 *Actual results:* 

 Broken host update: 

 <pre> 
 hammer host update --name hostXX.domainYY --build yes --operatingsystem "RHEL 8.7" --medium "RHEL Generic" --hostgroup-title "aaa/bbb/ccc" 
 </pre>  


 Logs from foreman/production.log: 
 <pre> 
 2023-03-06T13:39:26 [I|app|d3745c08]     Parameters: {"host"=>{"name"=>"hostXX.domainYY", "operatingsystem_id"=>18, "medium_id"=>13, "hostgroup_id"=>108, "build"=>true, "puppet_attributes"=>{}}, "apiv"=>"v2", "id"=>"373"} 
 </pre> 

 --------------- 

 Working host update: 

 <pre> 
 hammer host update --name hostXX.domainYY --build yes --operatingsystem "RHEL 8.7" --medium "RHEL Generic" --hostgroup-title "aaa/bbb/ccc" --environment cc8_tst 
 </pre> 

 Logs from foreman/production.log: 
 <pre> 
 2023-03-06T15:50:41 [I|app|91ca3168]     Parameters: {"host"=>{"name"=>"hostXX.domainYY", "operatingsystem_id"=>18, "medium_id"=>13, "hostgroup_id"=>108, "build"=>true, "environment_id"=>1, "puppet_attributes"=>{"environment_id"=>1}}, "apiv"=>"v2", "id"=>"373"} 
 </pre> 

 *Expected result:* 

 Change of hostgroup should not change environment 

 *Additional info:* 

 RHEL 8.6 
 Foreman 3.5.1 
 rubygem-hammer_cli Hammer 3.5.0 
 foreman_puppet 5.0.0

Back