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@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()
gerrit-hooks has posted comments on this change.
Change subject: network: devices: properly initialize attributes ......................................................................
Patch Set 1:
* Update Tracker::IGNORE, no bug url/s found * Check Bug-Url::IGNORE, no bug url/s found * Check Public Bug::WARN, no public bug url found * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
Martin Polednik has posted comments on this change.
Change subject: network: devices: properly initialize attributes ......................................................................
Patch Set 1: Code-Review+1
Failures are caused by previous patch in the series.
From Dan Kenigsberg danken@redhat.com:
Dan Kenigsberg has posted comments on this change.
Change subject: network: devices: properly initialize attributes ......................................................................
Patch Set 2: Code-Review-1
(1 comment)
https://gerrit.ovirt.org/#/c/65772/2/vdsm/virt/vmdevices/network.py File vdsm/virt/vmdevices/network.py:
PS2, Line 53: self.name = "" I prefer not to write false values
vdsm-patches@lists.fedorahosted.org