Skip to content

Commit

Permalink
Improve getting of workflow parameters when ingesting
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Gration committed Feb 5, 2018
1 parent d45666a commit 5128c68
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions galicaster/core/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,17 +296,21 @@ def gen_location(self, extension):
return os.path.join(self.export_path, name + '.' + extension)


def _ingest(self, mp, params={}):
def _ingest(self, mp, params=None):
"""Tries to immediately ingest the mediapackage into opencast.
If the ingest cannot be done, logger prints it properly.
Args:
mp(Mediapackage): the mediapackage to be immediately ingested.
mp (Mediapackage): the mediapackage to be immediately ingested.
params (dict): workflow and workflow_parameters for ingesting.
"""
if not self.oc_client:
raise Exception('Opencast client is not enabled')

workflow = None if not "workflow" in params else params["workflow"]
workflow_parameters = None if not "workflow_parameters" in params else params["workflow_parameters"]
workflow = None
workflow_parameters = None
if isinstance(params, dict):
workflow = params.get('workflow')
workflow_parameters = params.get('workflow_parameters')

self.dispatcher.emit('action-mm-refresh-row', mp.identifier)

Expand Down

0 comments on commit 5128c68

Please sign in to comment.