Francesco Romani has uploaded a new change for review.
Change subject: network: devices: properly initialize attributes
......................................................................
network: devices: properly initialize attributes
The `name' attribute used to be added to devices only after the
device data was refreshed from libvirt.
This can lead to AttributeErrors if a VM starts (very) slowly.
Furthermore, is good practice to initialize all the device
object attributes in __init__.
Change-Id: I21ef87a9524cbfe752e6cc0f7d1d9f6139c61dfb
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/virt/vmdevices/network.py
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/72/65772/1
diff --git a/vdsm/virt/vmdevices/network.py b/vdsm/virt/vmdevices/network.py
index 7628f06..618c34d 100644
--- a/vdsm/virt/vmdevices/network.py
+++ b/vdsm/virt/vmdevices/network.py
@@ -48,6 +48,7 @@
kwargs[attr] = net_api.DUMMY_BRIDGE
super(Interface, self).__init__(conf, log, **kwargs)
self.sndbufParam = False
+ self.name = ""
self.is_hostdevice = self.device == hwclass.HOSTDEV
self.vlanId = self.specParams.get('vlanid')
self._customize()
--
To view, visit
https://gerrit.ovirt.org/65772
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I21ef87a9524cbfe752e6cc0f7d1d9f6139c61dfb
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>