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>
This commit is contained in:

committed by
Damjan Marion

parent
dd3737284d
commit
3bce8ebfdf
@ -1,4 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import abc
|
||||
import six
|
||||
import unittest
|
||||
|
||||
from scapy.fields import BitField, ByteField, FlagsField, IntField
|
||||
@ -28,6 +31,7 @@ bind_layers(LISP_GPE_Header, IPv6, next_proto=2)
|
||||
bind_layers(LISP_GPE_Header, Ether, next_proto=3)
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class Driver(object):
|
||||
|
||||
config_order = ['locator-sets',
|
||||
@ -61,7 +65,7 @@ class Driver(object):
|
||||
Raw(payload))
|
||||
return packet
|
||||
|
||||
@abstractmethod
|
||||
@abc.abstractmethod
|
||||
def run(self):
|
||||
""" testing procedure """
|
||||
pass
|
||||
|
Reference in New Issue
Block a user