diff options
author | Paul Vinciguerra <pvinci@vinciconsulting.com> | 2018-11-24 21:46:05 -0800 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-02-26 11:31:42 +0000 |
commit | 3bce8ebfdfaf2a4b576012beb3516d1f4030c20c (patch) | |
tree | ad221819ad353c04e70a021978e50522a4b66998 /test/vpp_sub_interface.py | |
parent | dd3737284d5021e2e3bd0413b61aab14797e365c (diff) |
VPP-1508 Python3 abstract classes
Update the syntax to support abstract classes in python 2 and python 3.
Depends on: new style classes -- https://gerrit.fd.io/r/16166
Change-Id: Iad2c1240149f38b3faca1b37ab95d3d210e1daee
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test/vpp_sub_interface.py')
-rw-r--r-- | test/vpp_sub_interface.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/test/vpp_sub_interface.py b/test/vpp_sub_interface.py index 255cfffd827..63a0f543f20 100644 --- a/test/vpp_sub_interface.py +++ b/test/vpp_sub_interface.py @@ -1,12 +1,13 @@ from scapy.layers.l2 import Dot1Q -from abc import abstractmethod, ABCMeta +import abc +import six from vpp_pg_interface import VppPGInterface from vpp_papi_provider import L2_VTR_OP from vpp_interface import VppInterface +@six.add_metaclass(abc.ABCMeta) class VppSubInterface(VppPGInterface): - __metaclass__ = ABCMeta @property def parent(self): @@ -42,11 +43,11 @@ class VppSubInterface(VppPGInterface): super(VppSubInterface, self).set_sw_if_index(sw_if_index) self.set_vtr(L2_VTR_OP.L2_DISABLED) - @abstractmethod + @abc.abstractmethod def create_arp_req(self): pass - @abstractmethod + @abc.abstractmethod def create_ndp_req(self): pass @@ -56,7 +57,7 @@ class VppSubInterface(VppPGInterface): def resolve_ndp(self): super(VppSubInterface, self).resolve_ndp(self.parent) - @abstractmethod + @abc.abstractmethod def add_dot1_layer(self, pkt): pass |