from lxml import etree
import base64
import boto
-import cloudfiles
import errno
import hashlib
import mimetypes
import traceback
import xattr
+try:
+ import cloudfiles
+except ImportError:
+ cloudfiles = None
+
# Command-line options
global opts
If these environment variables are not given, we will fall back on libboto
defaults.
+
+Note: if python-cloudfiles is not installed, swift stores will not be able
+to be synced.
"""
###### Constants #######
ACL_XATTR = "rados.acl"
if (not opts.src_host):
raise ObsyncArgumentParsingException("src-host is required for s3 stores!")
if (opts.src_type == 'swift'):
+ if not cloudfiles:
+ raise ObsyncArgumentParsingException("cloudfiles library not found. Swift syncing unavailable")
if (not opts.src_authurl):
raise ObsyncArgumentParsingException("src-authurl is required for swift stores!")
if (opts.src_host):
if (not opts.dst_host):
raise ObsyncArgumentParsingException("dst-host is required for s3 stores!")
if (opts.dst_type == 'swift'):
+ if not cloudfiles:
+ raise ObsyncArgumentParsingException("cloudfiles library not found. Swift syncing unavailable")
if (not opts.dst_authurl):
raise ObsyncArgumentParsingException("dst-authurl is required for swift stores!")
if (opts.dst_host):