Igor Lvovsky has uploaded a new change for review. Change subject: Read 'source' of NIC interface only if exists ......................................................................
Read 'source' of NIC interface only if exists Change-Id: Idec5aef35298d93fd35d4f4a1933809c32ecce16 Signed-off-by: Igor Lvovsky <[email protected]> --- M vdsm/libvirtvm.py 1 file changed, 12 insertions(+), 8 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/49/8249/1 diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py index 557c1ed..75a78fb 100644 --- a/vdsm/libvirtvm.py +++ b/vdsm/libvirtvm.py @@ -2487,7 +2487,9 @@ mac = x.getElementsByTagName('mac')[0].getAttribute('address') alias = x.getElementsByTagName('alias')[0].getAttribute('name') model = x.getElementsByTagName('model')[0].getAttribute('type') - bridge = x.getElementsByTagName('source')[0].getAttribute('bridge') + source = x.getElementsByTagName('source') + if source: + bridge = source[0].getAttribute('bridge') # Get nic address address = self._getUnderlyingDeviceAddress(x) for nic in self._devices[vm.NIC_DEVICES]: @@ -2505,13 +2507,15 @@ knownDev = True # Add unknown nic device to vm's conf if not knownDev: - self.conf['devices'].append({'type': vm.NIC_DEVICES, - 'device': devType, - 'macAddr': mac, - 'nicModel': model, - 'network': bridge, - 'address': address, - 'alias': alias}) + nicDev = {'type': vm.NIC_DEVICES, + 'device': devType, + 'macAddr': mac, + 'nicModel': model, + 'address': address, + 'alias': alias} + if source: + nicDev['network'] = bridge + self.conf['devices'].append(nicDev) def _setWriteWatermarks(self): """ -- To view, visit http://gerrit.ovirt.org/8249 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idec5aef35298d93fd35d4f4a1933809c32ecce16 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Igor Lvovsky <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
