From edbbcb625b58a46d7b3f0dcbf22bb7163e5e6769 Mon Sep 17 00:00:00 2001 From: lissav Date: Fri, 31 May 2013 18:35:23 +0000 Subject: [PATCH] add new lines for array return git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16505 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/perl/xCAT/Postage.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/perl/xCAT/Postage.pm b/xCAT-server/lib/perl/xCAT/Postage.pm index 202fb21d1..a7aa8eeae 100644 --- a/xCAT-server/lib/perl/xCAT/Postage.pm +++ b/xCAT-server/lib/perl/xCAT/Postage.pm @@ -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; }