From 5204200e04368c767059b7888a613bd170f2c459 Mon Sep 17 00:00:00 2001 From: linggao Date: Wed, 27 May 2015 15:53:10 -0400 Subject: [PATCH] use under score _ instead of dash - in switch name for switchdiscover. --- xCAT-server/lib/xcat/plugins/switchdiscover.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/switchdiscover.pm b/xCAT-server/lib/xcat/plugins/switchdiscover.pm index 83552de86..bfbfbad28 100755 --- a/xCAT-server/lib/xcat/plugins/switchdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/switchdiscover.pm @@ -644,7 +644,7 @@ sub snmp_scan { Returns: hose: hostname of the switch if host is empty, try to lookup use ip address, otherwise format hostname - as switch and ip combination. ex: switch-9-114-5-6 + as switch and ip combination. ex: switch_9_114_5_6 =cut #-------------------------------------------------------------------------------- sub get_hostname { @@ -655,8 +655,8 @@ sub get_hostname { $host = gethostbyaddr( inet_aton($ip), AF_INET ); if ( !$host ) { my $ip_str = $ip; - $ip_str =~ s/\./\-/g; - $host = "switch-$ip_str"; + $ip_str =~ s/\./\_/g; + $host = "switch_$ip_str"; } } return $host;