details: http://www.bx.psu.edu/hg/galaxy/rev/97226da136bf changeset: 3171:97226da136bf user: Dan Blankenberg <dan@bx.psu.edu> date: Thu Dec 10 14:44:05 2009 -0500 description: Fix for external metadata auto-detect when using track_jobs_in_database. diffstat: lib/galaxy/datatypes/metadata.py | 4 ++-- lib/galaxy/tools/actions/metadata.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diffs (39 lines): diff -r 9666acdf74f4 -r 97226da136bf lib/galaxy/datatypes/metadata.py --- a/lib/galaxy/datatypes/metadata.py Thu Dec 10 14:37:22 2009 -0500 +++ b/lib/galaxy/datatypes/metadata.py Thu Dec 10 14:44:05 2009 -0500 @@ -510,8 +510,8 @@ .first() #there should only be one or None return None def get_dataset_metadata_key( self, dataset ): - # Set meta can be called on library items and history items, - # need to make different keys for them, since ids can overlap + # Set meta can be called on library items and history items, + # need to make different keys for them, since ids can overlap return "%s_%d" % ( dataset.__class__.__name__, dataset.id ) def setup_external_metadata( self, datasets, sa_session, exec_dir=None, tmp_dir=None, dataset_files_path=None, output_fnames=None, config_root=None, datatypes_config=None, job_metadata=None, kwds={} ): diff -r 9666acdf74f4 -r 97226da136bf lib/galaxy/tools/actions/metadata.py --- a/lib/galaxy/tools/actions/metadata.py Thu Dec 10 14:37:22 2009 -0500 +++ b/lib/galaxy/tools/actions/metadata.py Thu Dec 10 14:44:05 2009 -0500 @@ -21,11 +21,13 @@ job.session_id = trans.get_galaxy_session().id job.history_id = trans.history.id job.tool_id = tool.id + start_job_state = job.state #should be job.states.NEW try: # For backward compatibility, some tools may not have versions yet. job.tool_version = tool.version except: job.tool_version = "1.0.0" + job.state = job.states.WAITING #we need to set job state to something other than NEW, or else when tracking jobs in db it will be picked up before we have added input / output parameters trans.sa_session.add( job ) trans.sa_session.flush() #ensure job.id is available @@ -51,6 +53,7 @@ #Need a special state here to show that metadata is being set and also allow the job to run # i.e. if state was set to 'running' the set metadata job would never run, as it would wait for input (the dataset to set metadata on) to be in a ready state dataset.state = dataset.states.SETTING_METADATA + job.state = start_job_state #job inputs have been configured, restore initial job state trans.sa_session.flush() # Queue the job for execution