mirror of
https://github.com/ansible/awx.git
synced 2026-02-25 15:06:02 -03:30
add job data to filed wait jobs
This commit is contained in:
@@ -735,6 +735,7 @@ class ControllerAPIModule(ControllerModule):
|
|||||||
self.json_output['msg'] = 'Job with id {0} failed'.format(object_name)
|
self.json_output['msg'] = 'Job with id {0} failed'.format(object_name)
|
||||||
else:
|
else:
|
||||||
self.json_output['msg'] = 'The {0} - {1}, failed'.format(object_type, object_name)
|
self.json_output['msg'] = 'The {0} - {1}, failed'.format(object_type, object_name)
|
||||||
|
self.json_output["job_data"] = result["json"]
|
||||||
self.wait_output(result)
|
self.wait_output(result)
|
||||||
self.fail_json(**self.json_output)
|
self.fail_json(**self.json_output)
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ def test_ad_hoc_command_wait_successful(run_module, admin_user):
|
|||||||
result['elapsed'] = float(result['elapsed'])
|
result['elapsed'] = float(result['elapsed'])
|
||||||
assert result.pop('finished', '')[:10] == str(command.finished)[:10]
|
assert result.pop('finished', '')[:10] == str(command.finished)[:10]
|
||||||
assert result.pop('started', '')[:10] == str(command.started)[:10]
|
assert result.pop('started', '')[:10] == str(command.started)[:10]
|
||||||
assert result == {"status": "successful", "changed": False, "elapsed": command.elapsed, "id": command.id}
|
assert result.pop('status', "successful"), result
|
||||||
|
assert result.get('changed') is False
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db
|
@pytest.mark.django_db
|
||||||
@@ -27,14 +28,8 @@ def test_ad_hoc_command_wait_failed(run_module, admin_user):
|
|||||||
result['elapsed'] = float(result['elapsed'])
|
result['elapsed'] = float(result['elapsed'])
|
||||||
assert result.pop('finished', '')[:10] == str(command.finished)[:10]
|
assert result.pop('finished', '')[:10] == str(command.finished)[:10]
|
||||||
assert result.pop('started', '')[:10] == str(command.started)[:10]
|
assert result.pop('started', '')[:10] == str(command.started)[:10]
|
||||||
assert result == {
|
assert result.get('changed') is False
|
||||||
"status": "failed",
|
assert result.pop('status', "failed"), result
|
||||||
"failed": True,
|
|
||||||
"changed": False,
|
|
||||||
"elapsed": command.elapsed,
|
|
||||||
"id": command.id,
|
|
||||||
"msg": "The ad hoc command - 1, failed",
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.django_db
|
@pytest.mark.django_db
|
||||||
|
|||||||
Reference in New Issue
Block a user