Skip to content

Commit

Permalink
Fix AttributeError exception raised by Nova-compute
Browse files Browse the repository at this point in the history
Add locks to ensure that client object of ContrailVRouterApi is not used while it is being modified.
Closes-Bug: #1389157

Change-Id: I42bff175600d61beaff24904cbb86b21543829a1
  • Loading branch information
ashoksr committed Feb 12, 2015
1 parent b7f6da9 commit 751a395
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nova_contrail_vif/contrailvif.py
Expand Up @@ -18,6 +18,7 @@
import gettext
import threading
import time
import eventlet

gettext.install('contrail_vif')

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 751a395

Please sign in to comment.