25
25
from neutron_lib import constants
26
26
from neutron_lib import context
27
27
from neutron_lib import exceptions
28
- from neutron_lib import rpc as n_rpc
29
28
from oslo_concurrency import lockutils
30
29
from oslo_config import cfg
31
30
from oslo_log import helpers as log_helpers
38
37
from oslo_utils import timeutils
39
38
40
39
from neutron ._i18n import _
40
+ from neutron .agent .common import base_agent_rpc
41
41
from neutron .agent .common import resource_processing_queue as queue
42
42
from neutron .agent .linux import dhcp
43
43
from neutron .agent .linux import external_process
@@ -838,7 +838,7 @@ def disable_isolated_metadata_proxy(self, network):
838
838
del self ._metadata_routers [network .id ]
839
839
840
840
841
- class DhcpPluginApi (object ):
841
+ class DhcpPluginApi (base_agent_rpc . BasePluginApi ):
842
842
"""Agent side of the dhcp rpc API.
843
843
844
844
This class implements the client side of an rpc interface. The server side
@@ -858,11 +858,10 @@ class DhcpPluginApi(object):
858
858
859
859
def __init__ (self , topic , host ):
860
860
self .host = host
861
- target = oslo_messaging . Target (
861
+ super (). __init__ (
862
862
topic = topic ,
863
863
namespace = constants .RPC_NAMESPACE_DHCP_PLUGIN ,
864
864
version = '1.0' )
865
- self .client = n_rpc .get_client (target )
866
865
867
866
@property
868
867
def context (self ):
@@ -918,6 +917,11 @@ def get_dhcp_port(self, port_id):
918
917
if port :
919
918
return dhcp .DictModel (port )
920
919
920
+ def get_ports (self , port_filters ):
921
+ ports = super ().get_ports (self .context , port_filters )
922
+ if ports :
923
+ return [dhcp .DictModel (port ) for port in ports ]
924
+
921
925
def dhcp_ready_on_ports (self , port_ids ):
922
926
"""Notify the server that DHCP is configured for the port."""
923
927
cctxt = self .client .prepare (version = '1.5' )
0 commit comments