Skip to content

Commit

Permalink
Merge pull request #3 from jmchilton/CloudObjectStore
Browse files Browse the repository at this point in the history
Rework conditional dependency handling in galaxy.objectstore.cloud.
  • Loading branch information
VJalili authored Sep 5, 2017
2 parents f6586a8 + 26cbf04 commit cf56d1d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions lib/galaxy/objectstore/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,20 @@
from galaxy.util.sleeper import Sleeper
from ..objectstore import convert_bytes, ObjectStore

log = logging.getLogger(__name__)
logging.getLogger('boto').setLevel(logging.INFO) # Otherwise boto is quite noisy

try:
from cloudbridge.cloud.factory import CloudProviderFactory, ProviderList
except ImportError:
log.error("Could not import CloudBridge.")
CloudProviderFactory = None
ProviderList = None

log = logging.getLogger(__name__)

logging.getLogger('boto').setLevel(logging.INFO) # Otherwise boto is quite noisy

NO_BOTO_ERROR_MESSAGE = ("Cloud object store is configured, but no boto dependency available."
"Please install and properly configure boto or modify object store configuration.")
NO_CLOUDBRIDGE_ERROR_MESSAGE = (
"ObjectStore configured, but no cloudbridge dependency available."
"Please install cloudbridge or modify Object Store configuration."
)


class Cloud(ObjectStore):
Expand All @@ -42,6 +46,8 @@ class Cloud(ObjectStore):
"""
def __init__(self, config, config_xml):
super(Cloud, self).__init__(config)
if CloudProviderFactory is None:
raise Exception(NO_CLOUDBRIDGE_ERROR_MESSAGE)
self.staging_path = self.config.file_path
self.transfer_progress = 0
self._parse_config_xml(config_xml)
Expand Down

0 comments on commit cf56d1d

Please sign in to comment.