Browse Source

Merge "Handle exception raised in FIP allocation"

Zuul 2 months ago
parent
commit
0437fac8a4
1 changed files with 6 additions and 3 deletions
  1. 6
    3
      kuryr_kubernetes/controller/drivers/lb_public_ip.py

+ 6
- 3
kuryr_kubernetes/controller/drivers/lb_public_ip.py View File

@@ -69,12 +69,15 @@ class FloatingIpServicePubIPDriver(base.ServicePubIpDriver):
69 69
         if not public_network_id:
70 70
             raise cfg.RequiredOptError('external_svc_net',
71 71
                                        cfg.OptGroup('neutron_defaults'))
72
-
73
-        res_id, alloc_ip_addr = (
74
-            self._drv_pub_ip.allocate_ip(
72
+        try:
73
+            res_id, alloc_ip_addr = (self._drv_pub_ip.allocate_ip(
75 74
                 public_network_id, project_id, pub_subnet_id=public_subnet_id,
76 75
                 description='kuryr_lb',
77 76
                 port_id_to_be_associated=port_id_to_be_associated))
77
+        except Exception:
78
+            LOG.exception("Failed to allocate public IP - net_id:%s",
79
+                          public_network_id)
80
+            return None
78 81
         service_pub_ip_info = obj_lbaas.LBaaSPubIp(ip_id=res_id,
79 82
                                                    ip_addr=alloc_ip_addr,
80 83
                                                    alloc_method='pool')

Loading…
Cancel
Save