mirror of
https://github.com/openvswitch/ovs
synced 2025-10-19 14:37:21 +00:00
python: Fix output=CONTROLLER action.
When CONTROLLER is used as free key, it means output=CONTROLLER which is handled by decode_controller. However, it must output the KV in the right format: "output": {"format": "CONTROLLER"}. Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
committed by
Ilya Maximets
parent
1850e5e689
commit
542fdad701
@@ -35,7 +35,7 @@ def decode_output(value):
|
|||||||
def decode_controller(value):
|
def decode_controller(value):
|
||||||
"""Decodes the controller action."""
|
"""Decodes the controller action."""
|
||||||
if not value:
|
if not value:
|
||||||
return KeyValue("output", "controller")
|
return KeyValue("output", {"port": "CONTROLLER"})
|
||||||
else:
|
else:
|
||||||
# Try controller:max_len
|
# Try controller:max_len
|
||||||
try:
|
try:
|
||||||
|
@@ -22,7 +22,7 @@ from ovs.flow.decoders import EthMask, IPMask, decode_mask
|
|||||||
(
|
(
|
||||||
"actions=controller,controller:200",
|
"actions=controller,controller:200",
|
||||||
[
|
[
|
||||||
KeyValue("output", "controller"),
|
KeyValue("output", {"port": "CONTROLLER"}),
|
||||||
KeyValue("controller", {"max_len": 200}),
|
KeyValue("controller", {"max_len": 200}),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -524,6 +524,14 @@ from ovs.flow.decoders import EthMask, IPMask, decode_mask
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
"actions=MOD_NW_SRC:192.168.1.1,CONTROLLER,CONTROLLER:123",
|
||||||
|
[
|
||||||
|
KeyValue("MOD_NW_SRC", netaddr.IPAddress("192.168.1.1")),
|
||||||
|
KeyValue("output", {"port": "CONTROLLER"}),
|
||||||
|
KeyValue("CONTROLLER", {"max_len": 123}),
|
||||||
|
],
|
||||||
|
),
|
||||||
(
|
(
|
||||||
"actions=doesnotexist(1234)",
|
"actions=doesnotexist(1234)",
|
||||||
ParseError,
|
ParseError,
|
||||||
|
Reference in New Issue
Block a user