-Simplify plain text IP determination, hopefuly v6 agnostic

-Log condition where networks table lacks requisite data


git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@584 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2008-02-26 18:44:34 +00:00
parent c44d47b9d6
commit 0e27d30c5f

View File

@ -2,6 +2,7 @@
package xCAT_plugin::bmcconfig;
use Data::Dumper;
use xCAT::Table;
use Socket;
sub handled_commands {
return {
@ -22,11 +23,7 @@ sub genpassword {
sub net_parms {
my $ip = shift;
if ($ip =~ /[A-Za-z]/) {
my $addr = (gethostbyname($ip))[4];
my @bytes = unpack("C4",$addr);
$ip = join(".",@bytes);
}
$ip = inet_ntoa(inet_aton($ip));
my $nettab = xCAT::Table->new('networks');
unless ($nettab) { return undef };
my @nets = $nettab->getAllAttribs('net','mask','gateway');
@ -44,6 +41,7 @@ sub net_parms {
return ($ip,$mask,$gw);
}
}
syslog("local1|err","xCAT BMC configuration error, no appropriate network for $ip found in networks, unable to determine netmask");
}