Francesco Romani has uploaded a new change for review.
Change subject: v2v: Fix getExternalVMs if getting disk size failed ......................................................................
v2v: Fix getExternalVMs if getting disk size failed
In getExternalVMs we try to report the disk size, but if this info is not available for certain disk, we continue to collect info about other disks. Due to incorrect error handling, the request was aborted after the first error:
File "/usr/share/vdsm/v2v.py", line 684, in _add_disk_info disk['capacity'] = str(capacity) UnboundLocalError: local variable 'capacity' referenced before assignment
This patch fixes the error handling so failure to get disk size would not fail the entire request.
Change-Id: I7e91190a255a4d9bd2f474e125c49b18e3d3bfd4 Reported-by: Ian Fraser ian.fraser@asm.org.uk Bug-Url: https://bugzilla.redhat.com/1265556 Backport-to: 3.6 Signed-off-by: Nir Soffer nsoffer@redhat.com Reviewed-on: https://gerrit.ovirt.org/46540 Reviewed-by: Francesco Romani fromani@redhat.com Continuous-Integration: Jenkins CI --- M vdsm/v2v.py 1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/62/47362/1
diff --git a/vdsm/v2v.py b/vdsm/v2v.py index cdd831b..56340e8 100644 --- a/vdsm/v2v.py +++ b/vdsm/v2v.py @@ -683,9 +683,9 @@ _, capacity, alloc = vol.info() except libvirt.libvirtError: logging.exception("Error getting disk size") - - disk['capacity'] = str(capacity) - disk['allocation'] = str(alloc) + else: + disk['capacity'] = str(capacity) + disk['allocation'] = str(alloc)
def _add_disks(root, params):
automation@ovirt.org has posted comments on this change.
Change subject: v2v: Fix getExternalVMs if getting disk size failed ......................................................................
Patch Set 1:
* Update tracker::#1265556::OK * Check Bug-Url::OK * Check Public Bug::#1265556::OK, public bug * Check Product::#1265556::OK, Correct classification oVirt * Check TM::SKIP, not in a monitored branch (ovirt-3.5 ovirt-3.4 ovirt-3.3 ovirt-3.2) * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Francesco Romani has posted comments on this change.
Change subject: v2v: Fix getExternalVMs if getting disk size failed ......................................................................
Patch Set 1: Verified+1
verified on master, and using tests as per https://gerrit.ovirt.org/#/q/status:open+project:vdsm+branch:master+topic:v2...
Shahar Havivi has posted comments on this change.
Change subject: v2v: Fix getExternalVMs if getting disk size failed ......................................................................
Patch Set 1: Code-Review+1
Nir Soffer has posted comments on this change.
Change subject: v2v: Fix getExternalVMs if getting disk size failed ......................................................................
Patch Set 1: Code-Review+1
Francesco Romani has posted comments on this change.
Change subject: v2v: Fix getExternalVMs if getting disk size failed ......................................................................
Patch Set 1: Code-Review+2
Francesco Romani has submitted this change and it was merged.
Change subject: v2v: Fix getExternalVMs if getting disk size failed ......................................................................
v2v: Fix getExternalVMs if getting disk size failed
In getExternalVMs we try to report the disk size, but if this info is not available for certain disk, we continue to collect info about other disks. Due to incorrect error handling, the request was aborted after the first error:
File "/usr/share/vdsm/v2v.py", line 684, in _add_disk_info disk['capacity'] = str(capacity) UnboundLocalError: local variable 'capacity' referenced before assignment
This patch fixes the error handling so failure to get disk size would not fail the entire request.
Change-Id: I7e91190a255a4d9bd2f474e125c49b18e3d3bfd4 Reported-by: Ian Fraser ian.fraser@asm.org.uk Bug-Url: https://bugzilla.redhat.com/1265556 Backport-to: 3.6 Signed-off-by: Nir Soffer nsoffer@redhat.com Reviewed-on: https://gerrit.ovirt.org/46540 Reviewed-by: Francesco Romani fromani@redhat.com Continuous-Integration: Jenkins CI Reviewed-on: https://gerrit.ovirt.org/47362 Tested-by: Francesco Romani fromani@redhat.com Reviewed-by: Shahar Havivi shavivi@redhat.com --- M vdsm/v2v.py 1 file changed, 3 insertions(+), 3 deletions(-)
Approvals: Nir Soffer: Looks good to me, but someone else must approve Shahar Havivi: Looks good to me, but someone else must approve Jenkins CI: Passed CI tests Francesco Romani: Verified; Looks good to me, approved
automation@ovirt.org has posted comments on this change.
Change subject: v2v: Fix getExternalVMs if getting disk size failed ......................................................................
Patch Set 2:
* Update tracker::#1265556::OK * Set MODIFIED::bug 1265556::::#1265556::::IGNORE, not oVirt prod but ovirt-engine
vdsm-patches@lists.fedorahosted.org