Code Duplication    Length = 20-20 lines in 2 locations

v0x04/flow.py 1 location

@@ 51-70 (lines=20) @@
48
        return OFMatch(oxm_match_fields=oxm_fields)
49
50
51
class ActionOutput(ActionBase):
52
    """Action with an output port."""
53
54
    def __init__(self, port):
55
        """Require an output port.
56
57
        Args:
58
            port (int): Specific port number.
59
        """
60
        self.port = port
61
        self.action_type = 'output'
62
63
    @classmethod
64
    def from_of_action(cls, of_action):
65
        """Return a high-level ActionOuput instance from pyof ActionOutput."""
66
        return cls(port=of_action.port.value)
67
68
    def as_of_action(self):
69
        """Return a pyof ActionOuput instance."""
70
        return OFActionOutput(port=self.port)
71
72
73
class ActionPopVlan(ActionBase):

v0x01/flow.py 1 location

@@ 42-61 (lines=20) @@
39
        return match
40
41
42
class ActionOutput(ActionBase):
43
    """Action with an output port."""
44
45
    def __init__(self, port):
46
        """Require an output port.
47
48
        Args:
49
            port (int): Specific port number.
50
        """
51
        self.port = port
52
        self.action_type = 'output'
53
54
    @classmethod
55
    def from_of_action(cls, of_action):
56
        """Return a high-level ActionOuput instance from pyof ActionOutput."""
57
        return ActionOutput(port=of_action.port.value)
58
59
    def as_of_action(self):
60
        """Return a pyof ActionOuput instance."""
61
        return OFActionOutput(port=self.port)
62
63
64
class ActionSetVlan(ActionBase):