From 6e46cfff6a7b9840590826f3ce462a29823c2496 Mon Sep 17 00:00:00 2001 From: ligc Date: Tue, 23 Mar 2010 03:25:57 +0000 Subject: [PATCH] fix for bug 2974299: check spaces in the noderange syntax git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5553 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/DBobjectdefs.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index b913f704e..41ae75076 100644 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -284,12 +284,22 @@ sub processArgs # # - put attr=val operands in ATTRS hash + my $noderangespace = 0; while (my $a = shift(@ARGV)) { if (!($a =~ /=/)) { + # can not have spaces in the noderange + if ($noderangespace) + { + my $rsp; + $rsp->{data}->[0] = "noderange can not contain spaces."; + xCAT::MsgUtils->message("E", $rsp, $::callback); + return 2; + } + $noderangespace++; # the first arg could be a noderange or a list of args if (($::opt_t) && ($::opt_t ne 'node')) {