From 241247172483d189b5a52c44230b914de8017358 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Wed, 25 Aug 2010 17:46:09 +0000 Subject: [PATCH] -Allow plugins to specify multiple specifications of how to be selected git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7236 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/xcatd | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 7dd28eeab..ab12b8d88 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -507,11 +507,18 @@ sub scan_plugins { my $cmd_adds=${"xCAT_plugin::".$modname."::"}{handled_commands}->(); foreach (keys %$cmd_adds) { my $value = $_; - if (defined($cmd_handlers{$_})) { - # Add every plugin registration to cmd_handlers - push @{$cmd_handlers{$_}},[$modname,$cmd_adds->{$_}]; + my @modulehandlerinfos; + if (ref $cmd_adds->{$_}) { + @modulehandlerinfos=@{$cmd_adds->{$_}}; } else { - $cmd_handlers{$_} = [ [$modname,$cmd_adds->{$_}] ]; + @modulehandlerinfos=($cmd_adds->{$_}); + } + unless (defined($cmd_handlers{$_}) { + $cmd_handlers{$_} = [ ]; + } + # Add every plugin registration to cmd_handlers + foreach (@modulehandlerinfos) { + push @{$cmd_handlers{$_}},[$modname,$_]; } } }