Code Duplication    Length = 20-20 lines in 2 locations

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):

v0x04/flow.py 1 location

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