From bb0d44e4c6170ccac6c9936b687f715760bbc195 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 13 Dec 2011 19:59:42 +0000 Subject: [PATCH] Fix a warning message and ever so slightly improve performance git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11240 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/perl/xCAT/IPMI.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/IPMI.pm b/xCAT-server/lib/perl/xCAT/IPMI.pm index cc066be1d..d19b47149 100644 --- a/xCAT-server/lib/perl/xCAT/IPMI.pm +++ b/xCAT-server/lib/perl/xCAT/IPMI.pm @@ -117,10 +117,9 @@ sub new { return $self; } - if ($ip =~ /::ffff:\d+\.\d+\.+\d+\.\d+/) { + if ($ip and $ip =~ /::ffff:\d+\.\d+\.+\d+\.\d+/) { $ip =~ s/::ffff://; - } - if (not $ip and $bmc_n) { + } elsif (not $ip and $bmc_n) { $ip = inet_ntoa($bmc_n); } $bmc_handlers{$ip}=$self;