From 12c147a5c589fe8fd8ae3654f5c802d37ec8ae09 Mon Sep 17 00:00:00 2001 From: lissav Date: Mon, 15 Oct 2012 17:57:45 +0000 Subject: [PATCH] check for input of multiple internal postscript names git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14016 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/updatenode.pm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/updatenode.pm b/xCAT-server/lib/xcat/plugins/updatenode.pm index 81beebd11..900036286 100644 --- a/xCAT-server/lib/xcat/plugins/updatenode.pm +++ b/xCAT-server/lib/xcat/plugins/updatenode.pm @@ -464,11 +464,22 @@ sub preprocess_updatenode { my $rsp = {}; $rsp->{data}->[0] = - "The postcript $installdir/postscripts/$aa[0] does not exist."; + "The postscript $installdir/postscripts/$aa[0] does not exist."; $callback->($rsp); return; } } + } else { + # can only input one internal postscript on call + # updatenode -P defaults-postscripts-start-here + my $arraySize = @posts; + if ($arraySize > 1) { # invalid + my $rsp = {}; + $rsp->{data}->[0] = + "Only one internal postscript can be used with -P. Postscripts input were as follows:$postscripts"; + $callback->($rsp); + return; + } } } }