Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #24422 - k-c-h Check hostname is not current hostname #2808

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/katello/katello/hostname-change.rb
Expand Up @@ -77,6 +77,11 @@ def precheck
self.fail_with_message("Please specify a hostname.", @opt_parser)
end

if @old_hostname == @new_hostname
self.fail_with_message("The hostname specified must be different from the current hostname. If you have changed the hostname" \
" with another utility, please change it back to the original hostname before running this tool.")
end

STDOUT.puts "\nChecking hostname validity"
# This regex is an approximation of a hostname, it will handle most invalid hostnames and typos.
# Taken from https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9781449327453/ch08s15.html
Expand Down Expand Up @@ -252,11 +257,11 @@ def run
fpc_installer_args = self.get_fpc_answers
end

self.precheck

# Get the hostname from your system
@old_hostname = self.get_hostname

self.precheck

unless @foreman_proxy_content
STDOUT.puts "\nUpdating default #{@proxy}"
proxy_id = self.get_default_proxy_id
Expand Down
5 changes: 4 additions & 1 deletion packages/katello/katello/katello.spec
Expand Up @@ -4,7 +4,7 @@
%global homedir %{_datarootdir}/%{name}
%global confdir common
# %%global prerelease .rc1
%global release 5
%global release 6

Name: katello
Version: 3.9.0
Expand Down Expand Up @@ -204,6 +204,9 @@ Useful utilities for managing Katello services
%{_sysconfdir}/bash_completion.d/katello-service

%changelog
* Mon Jul 30 2018 John Mitsch <jomitsch@redhat.com> - 3.9.0-6
- k-c-h Check hostname is not current hostname

* Wed Jul 25 2018 Jonathon Turel <jturel@gmail.com> - 3.9.0-5
- Obsolete the python-gofer-qpid obsolete

Expand Down