Permalink
Browse files

Made boto optional.

Signed-off-by: Rob Hudson <rob@tastybrew.com>
  • Loading branch information...
brosner authored and Rob Hudson committed Apr 8, 2009
1 parent 8f595e7 commit 027a03028fc71ad5e343799d6708276b98a2373f
Showing with 11 additions and 2 deletions.
  1. +11 −2 dumpy/dumper.py
View
@@ -4,8 +4,14 @@
import shutil
import tempfile
-from boto.s3.key import Key
-from boto.s3.connection import S3Connection
+try:
+ import boto
+except ImportError:
+ boto = None
+else:
+ from boto.s3.key import Key
+ from boto.s3.connection import S3Connection
+
class MySQLDumpError(Exception):
pass
@@ -262,6 +268,9 @@ def parse_config(self):
self.bucket = self._get_option_value(self.config, 'S3Copy options', 'bucket')
def process(self, file):
+ if boto is None:
+ raise Exception("You must have boto installed before using S3 support.")
+
self.parse_config()
conn = S3Connection(self.access_key, self.secret_key)

0 comments on commit 027a030

Please sign in to comment.