add new lines for array return

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@16503 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2013-05-31 18:30:00 +00:00
parent 4e9d9d0b7a
commit f9841836f9

View File

@ -458,6 +458,7 @@ sub makescript {
if ((!defined($nofiles)) || ($nofiles == 0)) { # create file
print $script $inc;
close($script_fp{$node});
# TODO remove the blank lines
}
} #end foreach node
@ -467,7 +468,12 @@ sub makescript {
undef(%::GLOBAL_TABDUMP_HASH);
if ((defined($nofiles)) &&($nofiles == 1)){ # return array
my @scriptd = grep { /\S/ } split(/\n/,$inc);
return @scriptd;
my @goodscriptd;
foreach my $line (@scriptd){
$line = $line . "\n"; # add new line
push @goodscriptd, $line;
}
return @goodscriptd;
} else { # files were created
return 0;
}