From 08688dce2591ce2934134d50f202fe2a8bf63b2d Mon Sep 17 00:00:00 2001 From: lissav Date: Thu, 21 Jun 2012 18:05:44 +0000 Subject: [PATCH] fix defect 3530574 allow multiple command in policy table git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13145 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/perl/xCAT/xcatd.pm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/xcatd.pm b/xCAT-server/lib/perl/xCAT/xcatd.pm index f1318b14e..6bd6f3292 100644 --- a/xCAT-server/lib/perl/xCAT/xcatd.pm +++ b/xCAT-server/lib/perl/xCAT/xcatd.pm @@ -89,8 +89,17 @@ sub validate { next unless ($peerhost eq $rule->{host}); } if ($rule->{commands} and $rule->{commands} ne '*') { - #TODO: syntax for multiple commands - next unless ($request->{command}->[0] eq $rule->{commands}); + my @commands = split(",", $rule->{commands}); + my $found =0; + foreach my $cmd (@commands) { + if ($request->{command}->[0] eq $cmd) { + $found=1; + last; + } + } + if ($found == 0) { # no command match + next ; + } } if ($rule->{parameters} and $rule->{parameters} ne '*') { my $parms;