Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37727719
en ru br
ALT Linux repos
S:1.14.3-alt2

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


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};
   }
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin