From 3bea814ae43ada89e2deb7dd02fc72b47f9f8d9f Mon Sep 17 00:00:00 2001 From: ashoksingh Date: Thu, 5 Feb 2015 15:01:33 +0530 Subject: [PATCH] Fix AttributeError exception raised by Nova-compute Add locks to ensure that client object of ContrailVRouterApi is not used while it is being modified. Partial-Bug: #1389157 Change-Id: I79662c7e82f31f230250597aa86c00ccb3bb51dc --- nova_contrail_vif/contrailvif.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nova_contrail_vif/contrailvif.py b/nova_contrail_vif/contrailvif.py index 433352e..51f607f 100644 --- a/nova_contrail_vif/contrailvif.py +++ b/nova_contrail_vif/contrailvif.py @@ -18,6 +18,7 @@ import gettext import threading import time +import eventlet gettext.install('contrail_vif') @@ -110,7 +111,8 @@ class VRouterVIFDriver(LibVirtVIFDriver): def __init__(self, get_connection): super(VRouterVIFDriver, self).__init__(get_connection) - self._vrouter_client = ContrailVRouterApi(doconnect=True) + self._vrouter_semaphore = eventlet.semaphore.Semaphore() + self._vrouter_client = ContrailVRouterApi(doconnect=True, semaphore=self._vrouter_semaphore) timer = loopingcall.FixedIntervalLoopingCall(self._keep_alive) timer.start(interval=2)