katello-change-hostname should handle --no-enable-puppet properly
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1967974
Description of problem:
katello-change-hostname will error out if @scenario_answers['puppet'] is false (https://github.com/theforeman/foreman-packaging/blob/rpm/1.24/packages/katello/katello/hostname-change.rb#L170). We should skip `delete_puppet_certs` if this is the case.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Remove the puppet configuration from katello-answers.yaml
2. Run katello-change-hostname
deleting old certs
/usr/share/katello/hostname-change.rb:217:in `delete_puppet_certs': undefined method `' for nil:NilClass (NoMethodError)
from /usr/share/katello/hostname-change.rb:488:in `run'
from /sbin/katello-change-hostname:23:in `<main>'
hostname changed successfully
#1 Updated by Ian Ballou almost 2 years ago
- Subject changed from katello-change-hostname should handle --no-enable-puppet properly to katello-change-hostname should handle --no-enable-puppet properly
- Pull request https://github.com/theforeman/foreman-packaging/pull/6749 added
#2 Updated by The Foreman Bot almost 2 years ago
- Assignee set to Ewoud Kohl van Wijngaarden
- Status changed from New to Ready For Testing
#3 Updated by The Foreman Bot almost 2 years ago
- Fixed in Releases 3.0.0 added
#4 Updated by Ewoud Kohl van Wijngaarden almost 2 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman-packaging|ee14227ebe203d54e5640c67d7d4925c60b9b27a.
#5 Updated by The Foreman Bot almost 2 years ago
- Pull request https://github.com/theforeman/foreman-packaging/pull/6774 added
#6 Updated by Evgeni Golov almost 2 years ago
- Fixed in Releases 2.5.1 added
#7 Updated by Evgeni Golov almost 2 years ago
- Target version set to 2.5.1
#8 Updated by Amit Upadhye over 1 year ago
- Category set to RPMs
Fixes #32725 - Make delete_puppet_certs handle all input
If a user runs the installer with --no-enable-puppet the value of
@scenario_answers['puppet'] becomes false. false['ssldir'] raises an
exception. By returning early, it's handled safely.