check for either ! or : for delimeter in confignics and configeth

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14836 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
billwajda 2013-01-09 20:25:08 +00:00
parent a016b5efbf
commit 3176fb6a27
2 changed files with 25 additions and 5 deletions

View File

@ -60,7 +60,12 @@ while ( $cnt <= $net_cnt ) {
# eth0:1_0_0_0-255_255_0_0|network2,eth1:1_1_0_0
# create array of networks for this nic
foreach my $nic_networks (split(/,/,$nicnetworks)) {
my @net = split(/!/,$nic_networks);
my @net = ();
if ( $nic_networks =~ /!/ ) {
@net = split(/!/,$nic_networks);
} else {
@net = split(/:/,$nic_networks);
}
if ($net[0] eq $nic) {
@nic_nets = split(/\|/,$net[1]);
last;
@ -70,7 +75,12 @@ foreach my $nic_networks (split(/,/,$nicnetworks)) {
# get all nic ipaddress from $nicips: i.e. eth0:1.0.0.1|2.0.0.1,eth1:1.1.1.1
# Then get all ips for this specific nic, i.e. eth0.
foreach my $ips (split(/,/,$nicips)) {
my @ip = split(/!/,$ips);
my @ip = ();
if ( $ips =~ /!/ ) {
@ip = split(/!/,$ips);
} else {
@ip = split(/:/,$ips);
}
if ($ip[0] eq $nic ) {
@nic_ips = split(/\|/,$ip[1]);
}

View File

@ -18,7 +18,7 @@ my $nicips = $ENV{NICIPS};
my $niccustomscripts = $ENV{NICCUSTOMSCRIPTS};
my $nictypes = $ENV{NICTYPES};
my $xcatpostdir = "/xcatpost";
my %cust_script_nics = ();
my %cust_script_nics = (); # hash to save nics specified in niccustomscripts
system("logger -t xcat -p local4.info 'confignics: CUSTOMSCRIPTS: $niccustomscripts '");
# niccustomscripts specifies which NICS need to be configured.
@ -33,7 +33,12 @@ if ( defined $niccustomscripts && length $niccustomscripts > 0 ) {
foreach my $customscript (split(/,/,$niccustomscripts)) {
my @script = split(/!/,$customscript);
my @script = ();
if ( $customscript =~ /!/ ) {
@script = split(/!/,$customscript);
} else {
@script = split(/:/,$customscript);
}
$cust_script_nics{$script[0]} = 1;
runcmd("$xcatpostdir/$script[1]");
system("logger -t xcat -p local4.info 'confignics: executed custom script: $script[1] '");
@ -43,7 +48,12 @@ if ( defined $niccustomscripts && length $niccustomscripts > 0 ) {
# first determine nic from nicips and get the nictype. Invoke configeth or configiba based on nictype.
# i.e. $nictypes = "eth1:ethernet,eth2:ethernet"
foreach my $nic_type (split(/,/,$nictypes)) {
my @nic_and_type = split(/!/,$nic_type);
my @nic_and_type = ();
if ( $nic_type =~ /!/ ) {
@nic_and_type = split(/!/,$nic_type);
} else {
@nic_and_type = split(/:/,$nic_type);
}
if ("ETHERNET" eq uc($nic_and_type[1])) {
runcmd("$xcatpostdir/configeth $nic_and_type[0]");
system("logger -t xcat -p local4.info 'confignics: executed script: configeth $nic_and_type[0] '");