NSX|V3+P: Catch NSX error when trying to update edge firewall

When the plugins fails to update the NSX router edge firewall during
FWaaS command, it should raise the right error so that the status of
the firewall group will be set to ERROR

Change-Id: I539c2474a48e0e2f57f92403b97e0175bd004f43
This commit is contained in:
Adit Sarfaty 2019-06-11 13:20:28 +03:00
parent 8d7b24f9b6
commit 1037354f4a

View File

@ -60,8 +60,14 @@ class CommonEdgeFwaasV3Driver(fwaas_driver_base.EdgeFwaasDriverBaseV2):
# update each router once
for router_id in routers:
self.core_plugin.update_router_firewall(context, router_id,
from_fw=True)
try:
self.core_plugin.update_router_firewall(context, router_id,
from_fw=True)
except Exception as e:
# The core plugin failed to update the firewall
LOG.error("Failed to update NSX edge firewall for router %s: "
"%s", router_id, e)
raise self.driver_exception(driver=self.driver_name)
def should_apply_firewall_to_router(self, router_data):
"""Return True if the firewall rules should be added the router"""