Add the sample action to those that can be called in nested actions
(such as clone).

Signed-off-by: Adrian Moreno <amore...@redhat.com>
---
 python/ovs/flow/odp.py | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/python/ovs/flow/odp.py b/python/ovs/flow/odp.py
index 88aee17fb..ef7e5d6b8 100644
--- a/python/ovs/flow/odp.py
+++ b/python/ovs/flow/odp.py
@@ -336,6 +336,21 @@ class ODPFlow(Flow):
             **ODPFlow._tnl_action_decoder_args(),
         }
 
+        _decoders["sample"] = nested_kv_decoder(
+            KVDecoders(
+                {
+                    "sample": (lambda x: float(x.strip("%"))),
+                    "actions": nested_kv_decoder(
+                        KVDecoders(
+                            decoders=_decoders,
+                            default_free=decode_free_output,
+                        ),
+                        is_list=True,
+                    ),
+                }
+            )
+        )
+
         _decoders["clone"] = nested_kv_decoder(
             KVDecoders(decoders=_decoders, default_free=decode_free_output),
             is_list=True,
@@ -343,20 +358,6 @@ class ODPFlow(Flow):
 
         return {
             **_decoders,
-            "sample": nested_kv_decoder(
-                KVDecoders(
-                    {
-                        "sample": (lambda x: float(x.strip("%"))),
-                        "actions": nested_kv_decoder(
-                            KVDecoders(
-                                decoders=_decoders,
-                                default_free=decode_free_output,
-                            ),
-                            is_list=True,
-                        ),
-                    }
-                )
-            ),
             "check_pkt_len": nested_kv_decoder(
                 KVDecoders(
                     {
-- 
2.43.0

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to