[API replay] Avoid Octavia RPC errors

During API replay we should not call get_active_loadbalancers
or try and serve it, as the replay process will act both as
a client and RPC server.

Change-Id: I7cd620c2cca3ee8ac6e558f5aa7cb67a71e6b25b
This commit is contained in:
Salvatore Orlando 2021-10-08 13:50:08 -07:00
parent 9062ba2f00
commit dc308d59d8
2 changed files with 5 additions and 1 deletions

View File

@ -1272,6 +1272,10 @@ class ApiReplayClient(utils.PrepareObjectForMigration):
# Do nothing
pass
def get_active_loadbalancers(self, **kw):
# Do nothing
pass
endpoints = [MigrationOctaviaDriverEndpoint]
access_policy = dispatcher.DefaultRPCAccessPolicy
self.octavia_rpc_server = messaging.get_rpc_server(

View File

@ -753,7 +753,7 @@ class NSXOctaviaStatisticsCollector(object):
LOG.error("Octavia stats collect failed with %s", e)
def collect(self):
if not self.core_plugin.octavia_listener:
if not self.core_plugin.octavia_listener or cfg.CONF.api_replay_mode:
LOG.warning("Octavia stats collector cannot run with plugin %s",
self.core_plugin)
return