1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/1b3c54debe58/
changeset: 1b3c54debe58
user: natefoo
date: 2011-12-09 20:56:58
summary: Object Store: Create datasets when accessed via file_name.
affected #: 3 files
diff -r 25f3c2c08e97dc2b8d5ea2885d5083b887c65fba -r 1b3c54debe5813a6a6b91ab1cd3581f489d09abb lib/galaxy/exceptions/__init__.py
--- a/lib/galaxy/exceptions/__init__.py
+++ b/lib/galaxy/exceptions/__init__.py
@@ -18,3 +18,7 @@
class ItemOwnershipException( MessageException ):
pass
+
+class ObjectNotFound( Exception ):
+ """ Accessed object was not found """
+ pass
diff -r 25f3c2c08e97dc2b8d5ea2885d5083b887c65fba -r 1b3c54debe5813a6a6b91ab1cd3581f489d09abb lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -16,6 +16,7 @@
from galaxy.util.hash_util import *
from galaxy.web.form_builder import *
from galaxy.model.item_attrs import UsesAnnotations, APIItem
+from galaxy.exceptions import ObjectNotFound
from sqlalchemy.orm import object_session
from sqlalchemy.sql.expression import func
import os.path, os, errno, codecs, operator, socket, pexpect, logging, time, shutil
@@ -649,10 +650,12 @@
if not self.external_filename:
assert self.id is not None, "ID must be set before filename used (commit the object)"
assert self.object_store is not None, "Object Store has not been initialized for dataset %s" % self.id
- filename = self.object_store.get_filename( self.id )
- if not self.object_store.exists( self.id ):
- # Create directory if it does not exist
- self.object_store.create( self.id, dir_only=True )
+ try:
+ filename = self.object_store.get_filename( self.id )
+ except ObjectNotFound, e:
+ # Create file if it does not exist
+ self.object_store.create( self.id )
+ filename = self.object_store.get_filename( self.id )
return filename
else:
filename = self.external_filename
diff -r 25f3c2c08e97dc2b8d5ea2885d5083b887c65fba -r 1b3c54debe5813a6a6b91ab1cd3581f489d09abb lib/galaxy/objectstore/__init__.py
--- a/lib/galaxy/objectstore/__init__.py
+++ b/lib/galaxy/objectstore/__init__.py
@@ -18,6 +18,7 @@
from galaxy.jobs import Sleeper
from galaxy.model import directory_hash_id
from galaxy.objectstore.s3_multipart_upload import multipart_upload
+from galaxy.exceptions import ObjectNotFound
from boto.s3.key import Key
from boto.s3.connection import S3Connection
@@ -27,11 +28,6 @@
logging.getLogger('boto').setLevel(logging.INFO) # Otherwise boto is quite noisy
-class ObjectNotFound(Exception):
- """ Accessed object was not found """
- pass
-
-
class ObjectStore(object):
"""
ObjectStore abstract interface
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.