r1481@llin: dpavlin | 2007-11-02 15:28:43 +0100
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 2 Nov 2007 14:28:43 +0000 (14:28 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 2 Nov 2007 14:28:43 +0000 (14:28 +0000)
 support input modules definition right withing database definition in yaml.
 This basically means that you can replace type with module, so type will
 be depriciated soon

git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@969 07558da8-63fa-0310-ba24-9fe276d99e06

run.pl

diff --git a/run.pl b/run.pl
index ff1e602..576f4ca 100755 (executable)
--- a/run.pl
+++ b/run.pl
@@ -347,9 +347,16 @@ foreach my $database ( sort keys %{ $config->databases } ) {
 
                my $type = lc($input->{type});
 
-               die "I know only how to handle input types ", join(",", $config->webpac('inputs') ), " not '$type'!\n" unless (grep(/$type/, $config->webpac('inputs')));
+               # FIXME check if input module exists
+               my $input_module = $input->{module};
 
-               my $input_module = $config->webpac('inputs')->{$type};
+               if ( ! $input_module ) {
+                       if ( grep(/$type/, $config->webpac('inputs')) ) {
+                               $input_module = $config->webpac('inputs')->{$type};
+                       } else {
+                               $log->logdie("I know only how to handle input types ", join(",", $config->webpac('inputs') ), " not '$type'!" );
+                       }
+               }
 
                my @lookups = $parser->have_lookup_create($database, $input);