Group :: System/Configuration/Other
RPM: rex
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Patch: rex-1.14-alt-fix_CMDB_hostname.patch
Download
Download
Fix CMDB hostname detection
Using server name from 'Rex::get_current_connection()->{conn}->server->to_s'
as a host's hostname is unreliable: it can be either FQDN, or IP,
or name from the SSH config file.
--- ./lib/Rex/CMDB/Base.pm
+++ ./lib/Rex/CMDB/Base.pm
@@ -34,7 +34,7 @@ sub __get_hostname_for {
my $hostname = $server // Rex::get_current_connection()->{conn}->server->to_s;
- if ( $hostname eq '<local>' ) {
+ if ( ($hostname eq '<local>' ) || Rex::is_ssh() ) {
my %hw_info = Rex::Hardware->get('Host');
$hostname = $hw_info{Host}{hostname};
}