Created attachment 1710701 [details] Log messages when /etc/hosts is modified Description of problem: When trying to change hostname of Satellite, it incorrectly modifies /etc/hosts as follows: Original: 10.1.3.104 dhcp-3-57.vms.sat.rdu2.redhat.com dhcp-3-104.vms.sat.rdu2.redhat.com Modified: 10.1.3.104 dhcp-3-104.vms.sat.rdu2.redhat.com dhcp-3-104.vms.sat.rdu2.redhat.com Version-Release number of selected component (if applicable): 6.8.0 Snap 11 How reproducible: 100% Steps to Reproduce: 1.Install Satellite 2.Modify /etc/hosts by hand to include old hostname and new(desired) hostname as shown above in original section above. 3.Run hostname change command. satellite-change-hostname <new-hostname> -u admin -p "changeme" -y Actual results: Failure, stderr: No Match for argument: dhcp-3-140.vms.sat.rdu2.redhat.com-tomcat* /usr/share/katello/hostname-change.rb:378:in `restore_last_scenario_yaml': undefined method `path' for nil:NilClass (NoMethodError) from /usr/share/katello/hostname-change.rb:533:in `block in run' from /usr/share/katello/helper.rb:59:in `run_cmd' from /usr/share/katello/hostname-change.rb:530:in `run' from /usr/sbin/satellite-change-hostname:23:in `<main>' Expected results: Hostname change should succeed without errors. Additional info: As I stated earlier, /etc/hosts file gets modified in the process of hostname change and that seems to be a possible reason for failure or related to failure somehow.
*** This bug has been marked as a duplicate of bug 1861831 ***