Change in vdsm[master]: jobs: Fix job error format
gerrit-hooks has posted comments on this change. Change subject: jobs: Fix job error format .. Patch Set 3: * Update tracker: IGNORE, no Bug-Url found * Set MODIFIED::IGNORE, no Bug-Url found. -- To view, visit https://gerrit.ovirt.org/51145 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2fdc6db6ed7519e5860d34e3a602dbeecce9a998 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir SofferGerrit-Reviewer: Adam Litke Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Liron Aravot Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: jobs: Fix job error format
Nir Soffer has posted comments on this change. Change subject: jobs: Fix job error format .. Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.ovirt.org/51145 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2fdc6db6ed7519e5860d34e3a602dbeecce9a998 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir SofferGerrit-Reviewer: Adam Litke Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Liron Aravot Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: jobs: Fix job error format
Nir Soffer has submitted this change and it was merged. Change subject: jobs: Fix job error format .. jobs: Fix job error format The schema claims that job's error (ErrorInfo) is a map with "code" and "message" keys, but we returned an error response dict used for xmlrpc response. Add GeneralException.info() method, and use it to return the promised value. Change-Id: I2fdc6db6ed7519e5860d34e3a602dbeecce9a998 Signed-off-by: Nir SofferReviewed-on: https://gerrit.ovirt.org/51145 Continuous-Integration: Jenkins CI Reviewed-by: Liron Aravot --- M lib/vdsm/jobs.py M lib/vdsm/utils.py M tests/jobsTests.py 3 files changed, 6 insertions(+), 3 deletions(-) Approvals: Nir Soffer: Verified; Looks good to me, approved Jenkins CI: Passed CI tests Liron Aravot: Looks good to me, but someone else must approve -- To view, visit https://gerrit.ovirt.org/51145 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2fdc6db6ed7519e5860d34e3a602dbeecce9a998 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Liron Aravot Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: gerrit-hooks ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: jobs: Fix job error format
Nir Soffer has posted comments on this change. Change subject: jobs: Fix job error format .. Patch Set 2: Verified+1 -- To view, visit https://gerrit.ovirt.org/51145 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2fdc6db6ed7519e5860d34e3a602dbeecce9a998 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir SofferGerrit-Reviewer: Adam Litke Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Liron Aravot Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: jobs: Fix job error format
Liron Aravot has posted comments on this change. Change subject: jobs: Fix job error format .. Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.ovirt.org/51145 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2fdc6db6ed7519e5860d34e3a602dbeecce9a998 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir SofferGerrit-Reviewer: Adam Litke Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Liron Aravot Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: jobs: Fix job error format
Nir Soffer has uploaded a new change for review. Change subject: jobs: Fix job error format .. jobs: Fix job error format The schema species that job's error (ErrorInfo) is a map with "code" and "message" keys, but we returned an error response dict used for xmlrpc response. Add GeneralException.info() method, and use it to return the promised ErrorInfo. Change-Id: I2fdc6db6ed7519e5860d34e3a602dbeecce9a998 Signed-off-by: Nir Soffer--- M lib/vdsm/jobs.py M lib/vdsm/utils.py M tests/jobsTests.py 3 files changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/45/51145/1 diff --git a/lib/vdsm/jobs.py b/lib/vdsm/jobs.py index 1f47e31..69c9513 100644 --- a/lib/vdsm/jobs.py +++ b/lib/vdsm/jobs.py @@ -102,7 +102,7 @@ ret['progress'] = self.progress if self.error: -ret['error'] = self.error.response() +ret['error'] = self.error.info() return ret diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py index fd7db78..1c8f74c 100644 --- a/lib/vdsm/utils.py +++ b/lib/vdsm/utils.py @@ -98,8 +98,11 @@ def __str__(self): return "%s: %s" % (self.message, repr(self.value)) +def info(self): +return {'code': self.code, 'message': str(self)} + def response(self): -return {'status': {'code': self.code, 'message': str(self)}} +return {'status': self.info()} class ActionStopped(GeneralException): diff --git a/tests/jobsTests.py b/tests/jobsTests.py index 13d4a55..371e757 100644 --- a/tests/jobsTests.py +++ b/tests/jobsTests.py @@ -192,4 +192,4 @@ error = utils.GeneralException() job._error = error self.assertEqual(job.error, error) -self.assertEqual(error.response(), job.info()['error']) +self.assertEqual(error.info(), job.info()['error']) -- To view, visit https://gerrit.ovirt.org/51145 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2fdc6db6ed7519e5860d34e3a602dbeecce9a998 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: jobs: Fix job error format
gerrit-hooks has posted comments on this change. Change subject: jobs: Fix job error format .. Patch Set 1: * Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/51145 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2fdc6db6ed7519e5860d34e3a602dbeecce9a998 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir SofferGerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: jobs: Fix job error format
Liron Aravot has posted comments on this change. Change subject: jobs: Fix job error format .. Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.ovirt.org/51145 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2fdc6db6ed7519e5860d34e3a602dbeecce9a998 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir SofferGerrit-Reviewer: Adam Litke Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Liron Aravot Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: jobs: Fix job error format
gerrit-hooks has posted comments on this change. Change subject: jobs: Fix job error format .. Patch Set 2: * Update tracker: IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/51145 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2fdc6db6ed7519e5860d34e3a602dbeecce9a998 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir SofferGerrit-Reviewer: Adam Litke Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Liron Aravot Gerrit-Reviewer: gerrit-hooks Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches