commit/galaxy-central: natefoo: Don't check old_style paths in the DiskObjectStore by default.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/d4c6a250afd0/ Changeset: d4c6a250afd0 User: natefoo Date: 2013-09-20 17:10:31 Summary: Don't check old_style paths in the DiskObjectStore by default. Affected #: 3 files diff -r ab20415126a768f456314cfe587e4ce71fd2049b -r d4c6a250afd03a942e70f04ee7da8335dfea476b lib/galaxy/config.py --- a/lib/galaxy/config.py +++ b/lib/galaxy/config.py @@ -209,6 +209,7 @@ if self.nginx_upload_store: self.nginx_upload_store = os.path.abspath( self.nginx_upload_store ) self.object_store = kwargs.get( 'object_store', 'disk' ) + self.object_store_check_old_style = string_as_bool( kwargs.get( 'object_store_check_old_style', False ) ) self.object_store_cache_path = resolve_path( kwargs.get( "object_store_cache_path", "database/object_store_cache" ), self.root ) # Handle AWS-specific config options for backward compatibility if kwargs.get( 'aws_access_key', None) is not None: diff -r ab20415126a768f456314cfe587e4ce71fd2049b -r d4c6a250afd03a942e70f04ee7da8335dfea476b lib/galaxy/objectstore/__init__.py --- a/lib/galaxy/objectstore/__init__.py +++ b/lib/galaxy/objectstore/__init__.py @@ -198,6 +198,7 @@ super(DiskObjectStore, self).__init__(config, file_path=file_path, extra_dirs=extra_dirs) self.file_path = file_path or config.file_path self.config = config + self.check_old_style = config.object_store_check_old_style self.extra_dirs['job_work'] = config.job_working_directory self.extra_dirs['temp'] = config.new_file_path if extra_dirs is not None: @@ -264,14 +265,13 @@ return os.path.abspath(path) def exists(self, obj, **kwargs): - path = self._construct_path(obj, old_style=True, **kwargs) - # For backward compatibility, check root path first; otherwise, construct - # and check hashed path - if os.path.exists(path): - return True - else: - path = self._construct_path(obj, **kwargs) - return os.path.exists(path) + if self.check_old_style: + path = self._construct_path(obj, old_style=True, **kwargs) + # For backward compatibility, check root path first; otherwise, construct + # and check hashed path + if os.path.exists(path): + return True + return os.path.exists(self._construct_path(obj, **kwargs)) def create(self, obj, **kwargs): if not self.exists(obj, **kwargs): @@ -320,13 +320,13 @@ return content def get_filename(self, obj, **kwargs): - path = self._construct_path(obj, old_style=True, **kwargs) - # For backward compatibility, check root path first; otherwise, construct - # and return hashed path - if os.path.exists(path): - return path - else: - return self._construct_path(obj, **kwargs) + if self.check_old_style: + path = self._construct_path(obj, old_style=True, **kwargs) + # For backward compatibility, check root path first; otherwise, construct + # and return hashed path + if os.path.exists(path): + return path + return self._construct_path(obj, **kwargs) def update_from_file(self, obj, file_name=None, create=False, **kwargs): """ `create` parameter is not used in this implementation """ diff -r ab20415126a768f456314cfe587e4ce71fd2049b -r d4c6a250afd03a942e70f04ee7da8335dfea476b universe_wsgi.ini.sample --- a/universe_wsgi.ini.sample +++ b/universe_wsgi.ini.sample @@ -209,6 +209,12 @@ # distributed, hierarchical) #object_store = disk +# *Extremely* old Galaxy instances created datasets at the root of the +# `file_path` defined above. If your Galaxy instance has datasets at the root +# (instead of in directories composed by hashing the dataset id), you should +# enable this option to allow Galaxy to find them. +#object_store_check_old_style = False + # Credentials used by certain (s3, swift) object store backends #os_access_key = <your cloud object store access key> #os_secret_key = <your cloud object store secret key> 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.
participants (1)
-
commits-noreply@bitbucket.org