2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-22 09:58:01 +00:00

python: Interpret free keys as output in clone.

clone-like actions can also output to ports by specifying the port name.

Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
Adrian Moreno 2022-12-19 17:13:49 +01:00 committed by Ilya Maximets
parent 542fdad701
commit c395e9810e
2 changed files with 17 additions and 2 deletions

View File

@ -402,10 +402,12 @@ class OFPFlow(Flow):
return {
"learn": decode_learn(action_decoders),
"clone": nested_kv_decoder(
KVDecoders(action_decoders, ignore_case=True), is_list=True
KVDecoders(action_decoders, default_free=decode_free_output,
ignore_case=True), is_list=True
),
"write_actions": nested_kv_decoder(
KVDecoders(action_decoders, ignore_case=True), is_list=True
KVDecoders(action_decoders, default_free=decode_free_output,
ignore_case=True), is_list=True
),
}

View File

@ -532,6 +532,19 @@ from ovs.flow.decoders import EthMask, IPMask, decode_mask
KeyValue("CONTROLLER", {"max_len": 123}),
],
),
(
"actions=LOCAL,clone(myport,CONTROLLER)",
[
KeyValue("output", {"port": "LOCAL"}),
KeyValue(
"clone",
[
{"output": {"port": "myport"}},
{"output": {"port": "CONTROLLER"}},
]
),
],
),
(
"actions=doesnotexist(1234)",
ParseError,