Skip to content

Commit

Permalink
Merge 8294464 into 0e23400
Browse files Browse the repository at this point in the history
  • Loading branch information
irontablee committed Jul 20, 2016
2 parents 0e23400 + 8294464 commit ef3aa63
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
6 changes: 5 additions & 1 deletion genie-client/src/main/python/pygenie/adapter/genie_3.py
Expand Up @@ -141,6 +141,10 @@ def construct_base_payload(job):
else:
dependencies.append(dep)

description = job.get('description')
if isinstance(description, dict):
description = json.dumps(description)

payload = {
'applications': job.get('application_ids'),
'attachments': attachments,
Expand All @@ -150,7 +154,7 @@ def construct_base_payload(job):
'commandArgs': job.get('command_arguments') or job.cmd_args,
'commandCriteria': job.get('command_tags') or job.default_command_tags,
'dependencies': dependencies,
'description': job.get('description'),
'description': description,
'disableLogArchival': not job.get('archive'),
'email': job.get('email'),
'group': job.get('group'),
Expand Down
12 changes: 5 additions & 7 deletions genie-client/src/main/python/pygenie/jobs/core.py
Expand Up @@ -332,7 +332,7 @@ def dependencies(self, _dependencies):
:py:class:`GenieJob`: self
"""

@add_to_repr('overwrite')
@add_to_repr('append')
def description(self, description):
"""
Sets the description for the job.
Expand All @@ -344,12 +344,10 @@ def description(self, description):
:py:class:`GenieJob`: self
"""

assert description is not None, 'description should be a string'

if isinstance(description, dict):
description = json.dumps(description)

self._description = description
if isinstance(self._description, dict) and isinstance(description, dict):
self._description.update(description)
else:
self._description = description

return self

Expand Down
2 changes: 1 addition & 1 deletion genie-client/src/main/python/tests/test_utils.py
Expand Up @@ -74,7 +74,7 @@ def test_gen_job_id_new(self, mock_reattach_job):

@patch('pygenie.jobs.utils.reattach_job')
def test_gen_job_id_return_success_true_running(self, mock_reattach_job):
"""Test generating job id with returning successful job set to True a job that is running."""
"""Test generating job id with returning successful job set to True with a job that is running."""

job_id = 'running'

Expand Down

0 comments on commit ef3aa63

Please sign in to comment.