This commit is contained in:
John Chilton
2015-02-08 15:31:45 -05:00
3 changed files with 10 additions and 11 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ class FormDefinitionFactory( object ):
#load fields
fields = []
fields_elem = elem.find( 'fields' )
if fields_elem:
if fields_elem is not None:
for field_elem in fields_elem.findall( 'field' ):
field_type = field_elem.get( 'type' )
assert field_type in self.field_type_factories, 'Invalid form field type ( %s ).' % field_type
@@ -96,9 +96,9 @@ class ExternalServiceType( object ):
def parse_run_details( self, root ):
self.run_details = {}
run_details_elem = root.find( 'run_details' )
if run_details_elem:
if run_details_elem is not None:
results_elem = run_details_elem.find( 'results' )
if results_elem:
if results_elem is not None:
# Get the list of resulting datatypes
# TODO: the 'results_urls' attribute is only useful if the transfer protocol is http(s), so check if that is the case.
self.run_details[ 'results' ], self.run_details[ 'results_urls' ] = self.parse_run_details_results( results_elem )
+7 -8
View File
@@ -31,11 +31,11 @@ class WorkflowSchedulingManager( object ):
self.app = app
self.__job_config = app.job_config
self.workflow_schedulers = {}
self.active_workflow_schedulers = {} # Passive workflow schedulers
# won't need to be monitored I
# guess.
self.active_workflow_schedulers = {}
# Passive workflow schedulers won't need to be monitored I guess.
self.request_monitor = None
self.__plugin_classes = self.__plugins_dict()
self.__init_schedulers()
@@ -67,7 +67,7 @@ class WorkflowSchedulingManager( object ):
try:
self.request_monitor.shutdown()
except Exception:
log.exception( "Failed to shutdown worklfow request monitor." )
log.exception( "Failed to shutdown workflow request monitor." )
def queue( self, workflow_invocation, request_params ):
workflow_invocation.state = model.WorkflowInvocation.states.NEW
@@ -112,8 +112,7 @@ class WorkflowSchedulingManager( object ):
def __init_schedulers_for_element( self, plugins_element ):
plugins_kwds = dict( plugins_element.items() )
self.default_scheduler_id = plugins_kwds.get( 'default', DEFAULT_SCHEDULER_ID )
for plugin_element in plugins_element.getchildren():
for plugin_element in plugins_element:
plugin_type = plugin_element.tag
plugin_kwds = dict( plugin_element.items() )
workflow_scheduler_id = plugin_kwds.get( 'id', None )
@@ -134,7 +133,7 @@ class WorkflowSchedulingManager( object ):
self.workflow_schedulers[ workflow_scheduler_id ] = workflow_scheduler
if isinstance( workflow_scheduler, galaxy.workflow.schedulers.ActiveWorkflowSchedulingPlugin ):
self.active_workflow_schedulers[ workflow_scheduler_id ] = workflow_scheduler
def __start_request_monitor( self ):
self.request_monitor = WorkflowRequestMonitor( self.app, self )