From: Mariana Marasoiu Date: Tue, 16 Aug 2011 16:16:36 +0000 (+0300) Subject: ppf: Replace hardcoded database name in libtorrent/log_parser with X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=414ab80dcf3fcb8a63977c97ef7cc76a77a685e0;p=cs-p2p-next.git ppf: Replace hardcoded database name in libtorrent/log_parser with configuration file received as argument. --- diff --git a/ppf/log-parser-mysql/libtorrent/log_parser b/ppf/log-parser-mysql/libtorrent/log_parser index 39f9199..8020578 100755 --- a/ppf/log-parser-mysql/libtorrent/log_parser +++ b/ppf/log-parser-mysql/libtorrent/log_parser @@ -1,7 +1,7 @@ #!/bin/bash ARCHIVE=$1 -DB_NAME=$2 +DB_CONFIG=$2 SWARM_ID=$3 DIR_LOCAL="$(cd "$(dirname "$0")" && pwd)" DIR_ARCHIVE="$(cd "$(dirname "$1")" && pwd)" @@ -31,7 +31,7 @@ for folder in $( find $DIR_ARCHIVE/temp -type d -name 'libtorrent_logs*' | sort for log_file in $(find $folder -type f | sort); do if [[ "$log_file" =~ [[:digit:]]*.log ]]; then echo "$log_file" - yes y | PYTHONPATH=$DIR_LOCAL/../../db-mysql/ python $DIR_LOCAL/LogParser.py -i $SWARM_ID -f $log_file $DB_NAME + yes y | PYTHONPATH=$DIR_LOCAL/../../db-mysql/ python $DIR_LOCAL/LogParser.py -i $SWARM_ID -f $log_file $DB_CONFIG fi done done @@ -39,7 +39,7 @@ echo -e "Log files parsed.\n" # fill status information echo -e "Parsing status file.\n" -yes y | PYTHONPATH=$DIR_LOCAL/../../db-mysql/ python $DIR_LOCAL/StatusParser.py -i $SWARM_ID -f $DIR_ARCHIVE/temp/status.log $DB_NAME +yes y | PYTHONPATH=$DIR_LOCAL/../../db-mysql/ python $DIR_LOCAL/StatusParser.py -i $SWARM_ID -f $DIR_ARCHIVE/temp/status.log $DB_CONFIG echo -e "Status file parsed.\n" echo -e "DONE!\n"