@@ -106,14 +106,14 @@ class PortBindingChassisCreatedEvent(PortBindingChassisEvent):
106106 LOG_MSG = "Port %s in datapath %s bound to our chassis"
107107
108108 def __init__ (self , metadata_agent ):
109- events = (self .ROW_UPDATE ,)
109+ events = (self .ROW_CREATE , self . ROW_UPDATE ,)
110110 super (PortBindingChassisCreatedEvent , self ).__init__ (
111111 metadata_agent , events )
112112
113113 def match_fn (self , event , row , old ):
114114 try :
115115 return (row .chassis [0 ].name == self .agent .chassis and
116- not old .chassis )
116+ ( event == self . ROW_CREATE or not old .chassis ) )
117117 except (IndexError , AttributeError ):
118118 return False
119119
@@ -297,8 +297,9 @@ def start(self):
297297 self .conf , self .chassis , sb_idl = self .sb_idl )
298298 self ._proxy .run ()
299299
300- # Do the initial sync.
301- self .sync ()
300+ # Do the initial sync. Provisioning handled by
301+ # PortBindingChassisCreatedEvent on initial db dump
302+ self .sync (provision = False )
302303
303304 # Register the agent with its corresponding Chassis
304305 self .register_metadata_agent ()
@@ -349,7 +350,7 @@ def get_networks_datapaths(self):
349350 return set (p .datapath for p in self ._vif_ports (ports ))
350351
351352 @_sync_lock
352- def sync (self ):
353+ def sync (self , provision = True ):
353354 """Agent sync.
354355
355356 This function will make sure that all networks with ports in our
@@ -379,8 +380,9 @@ def sync(self):
379380 # resync all network namespaces based on the associated datapaths,
380381 # even those that are already running. This is to make sure
381382 # everything within each namespace is up to date.
382- for datapath in net_datapaths :
383- self .provision_datapath (datapath )
383+ if provision :
384+ for datapath in net_datapaths :
385+ self .provision_datapath (datapath )
384386
385387 @staticmethod
386388 def _get_veth_name (datapath ):
0 commit comments