Nir Soffer has posted comments on this change.
Change subject: Refactor v2v jobs for reusability
......................................................................
Patch Set 5:
(2 comments)
Looks good, -1 for visibility.
https://gerrit.ovirt.org/#/c/44857/5/vdsm/jobs.py
File vdsm/jobs.py:
Line 142: return response.error(e.name)
Line 143: return response.success()
Line 144:
Line 145:
Line 146: def get_jobs_info(type_filter=None):
Since all other names are short and nice, I think we get shorten it to info(). job.info()
return info for one job, jobs.info() for many.
Line 147: with _lock:
Line 148: jobs = _jobs.values()
Line 149: return {job.id: job.info() for job in jobs
Line 150: if not type_filter or job.job_type == type_filter}
https://gerrit.ovirt.org/#/c/44857/5/vdsm/v2v.py
File vdsm/v2v.py:
Line 107:
Line 108: def get_jobs_status():
Line 109: all_jobs = jobs.get_jobs_info()
Line 110: return {job_id: status for (job_id, status) in all_jobs.items()
Line 111: if status['job_type'] == _V2V_JOB_TYPE}
Why not use your new shiny filtering in jobs.get_jobs_info() ?
Line 112:
Line 113:
Line 114: def get_external_vms(uri, username, password):
Line 115: if not supported():
--
To view, visit
https://gerrit.ovirt.org/44857
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ida6b1c460c5030c820c540e836e423d4632410df
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Arik Hadas <ahadas(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek <mskrivan(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Shahar Havivi <shavivi(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: Yes