Bug #24422

katello-change-hostname should check current hostname to make sure that the hostname was not changed with a different tool

Added by John Mitsch over 1 year ago. Updated over 1 year ago.

Backup & Restore
Target version:
Bugzilla link:
Fixed in Releases:
Found in Releases:


Cloned from

Description of problem:

This is to avoid bad tool usage as currently its possible to change the hostname with hostnamectl and then execute katello-change-hostname which leads to the error:

Error: smart_proxy not found
Couldn't find default Capsule id
Failed 'hammer -u admin -p changeme --output json capsule info --name old-hostname' with exit code 70

Version-Release number of selected component (if applicable):

latest dev

How reproducible:

Change satellite hostname with hostnamectl and then run katello-change-hostname

Steps to Reproduce:

1. hostnameclt set-hostname
2. katello-change-hostname -u admin -p XXX (will fail with above)

Changing to the old hostname with hostnamectl so katello-change-hostname can pass:

3. hostnamectl set-hostname
4. katello-change-hostname -u admin -p XXX (will pass)

Mongo will contain old hostname:
5. > db.event_listeners.find() { "_id" : ObjectId("5b0ff0b0226fa42c34df85b1"), "notifier_config" : { "url" : "

Actual results:

katello-change-hostname will run when hostname was already changed with hostnamectl which produces error.

Expected results:

Add check to find out if new hostname used with katello-change-hostname is matching with current hostname from hostnamectl. It should not match, if it does it should error out and not proceed further.


#1 Updated by John Mitsch over 1 year ago

  • Assignee set to John Mitsch
  • Category set to Backup & Restore
  • Description updated (diff)

#2 Updated by The Foreman Bot over 1 year ago

  • Status changed from New to Ready For Testing
  • Pull request added

#3 Updated by John Mitsch over 1 year ago

  • Triaged changed from No to Yes
  • Target version set to Katello 3.9.0

#4 Updated by Zach Huntington-Meath over 1 year ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF