From bb0656d7b68cfb5640a4198ac1df2dc209c32770 Mon Sep 17 00:00:00 2001 From: Sandy Walsh Date: Tue, 3 Jun 2014 03:46:20 +0000 Subject: [PATCH] Added support for Swift shoebox handler --- README.md | 7 +++++++ build.sh | 3 +++ shoebox.conf | 15 ++++++++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2da2f10..5aa7ccf 100644 --- a/README.md +++ b/README.md @@ -21,3 +21,10 @@ with the `shoebox.conf` configuration file. This will read events from the rabbit queue and save them to local files. The working directory and archive directory for `shoebox` is specified in `shoebox.conf`. +The sandbox environment configures `shoebox` to upload archive files +to Swift automatically. This requires you create a credentials file +in the `.../sandbox/` directory (like in +`.../git/sandbox/etc/sample_rax_credentials.conf`) Call it +`swift_credentials.conf` or alter the `shoebox.conf` file accordingly. If +you don't have access to a Swift server, like CloudFiles, read +the config file for details on disabling this feature. diff --git a/build.sh b/build.sh index e9c2a55..c89ead3 100755 --- a/build.sh +++ b/build.sh @@ -30,9 +30,12 @@ source ./$VENV_DIR/bin/activate # Some extra required libs ... pip install librabbitmq +# Needed by pyrax: +pip install pbr for file in $SOURCE_DIR/* do + echo "----------------------- $file ------------------------------" cd $file rm -rf build dist python setup.py install diff --git a/shoebox.conf b/shoebox.conf index bab1528..43885e6 100644 --- a/shoebox.conf +++ b/shoebox.conf @@ -43,6 +43,19 @@ destination_folder=../../../data/archive filename_template=events_%Y_%m_%d_%X_%f.dat roll_checker=shoebox.roll_checker:SizeRollChecker roll_size_mb=1 -callback=shoebox.handlers:MoveFileCallback distiller_conf=../../../distiller.conf + +# Swift upload support +# create a credentials file (see shoebox/bin/sample_credentials.conf) +callback=shoebox.handlers:CallbackList +callback_list=shoebox.handlers:MoveFileCallback, shoebox.handlers:SwiftUploadCallback, shoebox.handlers:DeleteFileCallback +container=sandbox +credentials_file=../../../swift_credentials.conf +auth_method=rackspace +region=DFW + +# If you don't want Swift support, comment the above callback= +# entry and uncomment this one: +#callback=shoebox.handlers:MoveFileCallback +# which will just move the file into the archive directory.