Change in vdsm[master]: v2v: refactor get_external_vms

fromani at redhat.com fromani at redhat.com
Thu Dec 10 15:54:28 UTC 2015


Francesco Romani has posted comments on this change.

Change subject: v2v: refactor get_external_vms
......................................................................


Patch Set 3: Code-Review-1

(2 comments)

a patch purely moving code around would be ideal, but this is not terribly important. But I see a try/except sneaked in, I wonder if this is intentional.

https://gerrit.ovirt.org/#/c/49636/3/vdsm/v2v.py
File vdsm/v2v.py:

Line 657:                 _add_general_info(root, params)
Line 658:             except InvalidVMConfiguration as e:
Line 659:                 logging.error('error parsing domain xml, msg: %s  xml: %s',
Line 660:                               e.message, vm.XMLDesc(0))
Line 661:             else:
this is not just code move: the old code has "continue", now we have "else".
We usually avoid moves + changes (better to split them), but in this case could be OK...
Line 662:                 _add_networks(root, params)
Line 663:                 _add_disks(root, params)
Line 664:                 for disk in params['disks']:
Line 665:                     _add_disk_info(conn, disk)


Line 663:                 _add_disks(root, params)
Line 664:                 for disk in params['disks']:
Line 665:                     _add_disk_info(conn, disk)
Line 666:                 vms.append(params)
Line 667:     except libvirt.libvirtError as e:
...but I see also this new broad try/catch, which could be OK, but does not protects against ET.fromstring() raising.
Is this intentional?
Line 668:         logging.error('error parsing domain: %s', e)
Line 669: 
Line 670: 
Line 671: def _add_vm_info(vm, params):


-- 
To view, visit https://gerrit.ovirt.org/49636
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If5c331b3136b61b0ee81829d7e71eedbbc1fa6b9
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi <shavivi at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Shahar Havivi <shavivi at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list