@@ -467,7 +467,7 @@ def _get_neutron_client(self):
467467 try :
468468 return clients .get_neutron_client ()
469469 except driver_exceptions .DriverError as e :
470- LOG .warn (f"Cannot get client from neutron { e } " )
470+ LOG .warning (f"Cannot get client from neutron { e } " )
471471 return None
472472
473473 def _get_vip_port_and_subnet_from_lb (self , neutron_client , vip_port_id ,
@@ -482,10 +482,10 @@ def _get_vip_port_and_subnet_from_lb(self, neutron_client, vip_port_id,
482482 subnet_requested
483483 )
484484 except openstack .exceptions .ResourceNotFound :
485- LOG .warn ("Load balancer VIP port and subnet not found." )
485+ LOG .warning ("Load balancer VIP port and subnet not found." )
486486 return None , None
487487 except AttributeError :
488- LOG .warn ("Load Balancer VIP port missing information." )
488+ LOG .warning ("Load Balancer VIP port missing information." )
489489 return None , None
490490
491491 def _build_external_ids (self , loadbalancer , port ):
@@ -3179,7 +3179,7 @@ def get_lsp(self, port_id, network_id):
31793179 try :
31803180 ls = self .ovn_nbdb_api .lookup ('Logical_Switch' , ls_name )
31813181 except idlutils .RowNotFound :
3182- LOG .warn (f"Logical Switch { ls_name } not found." )
3182+ LOG .warning (f"Logical Switch { ls_name } not found." )
31833183 return
31843184 for port in ls .ports :
31853185 if port_id in port .name :
@@ -3211,9 +3211,9 @@ def get_fip_from_vip(self, lb):
32113211 try :
32123212 return list (neutron_client .ips (port_id = lb .vip_port_id ))
32133213 except openstack .exceptions .HttpException as e :
3214- LOG .warn ("Error on fetch fip for "
3215- f"{ lb .loadbalancer_id } "
3216- f"Error: { str (e )} " )
3214+ LOG .warning ("Error on fetch fip for "
3215+ f"{ lb .loadbalancer_id } "
3216+ f"Error: { str (e )} " )
32173217
32183218 def _add_lbhc (self , ovn_lb , pool_key , info ):
32193219 hm_id = info [constants .ID ]
@@ -3787,7 +3787,8 @@ def hm_sync(self, hm, ovn_lb, pool_key):
37873787 :param ovn_lb: The OVN LoadBalancer object that needs to be sync
37883788 :param pool_key: The pool_key where health monitor is associated
37893789 """
3790- lbhcs , ovn_lb = self ._find_ovn_lb_from_hm_id (hm [constants .ID ])
3790+ lbhcs , _ovn_lb = self ._find_ovn_lb_from_hm_id (hm [constants .ID ])
3791+ ovn_lb = _ovn_lb if _ovn_lb else ovn_lb
37913792 if not lbhcs :
37923793 LOG .debug ("Loadbalancer health check %s not found!" ,
37933794 hm [constants .ID ])
0 commit comments