fix(papi): Do not check CRC on None 64/41364/2
authorVratko Polak <[email protected]>
Wed, 7 Aug 2024 11:02:54 +0000 (13:02 +0200)
committerVratko Polak <[email protected]>
Wed, 7 Aug 2024 11:02:54 +0000 (13:02 +0200)
None can happen when VPP crashes
(and pipe is not detected as broken yet) or stalls.
Avoid CRC check in that case, raise early with error message.

Change-Id: I15a957420320affd72dbd99fa48c309b28f0511a
Signed-off-by: Vratko Polak <[email protected]>
resources/libraries/python/PapiExecutor.py

index a55638a..04dc0d9 100644 (file)
@@ -1051,6 +1051,10 @@ class PapiSocketExecutor:
                 PapiSocketExecutor._drain(vpp_instance, err_msg)
             # Process replies for this command.
             for reply in replies:
+                if reply is None:
+                    raise RuntimeError(
+                        f"{err_msg}\nNo reply to sync call. VPP crashed?"
+                    )
                 self.crc_checker.check_api_name(reply.__class__.__name__)
                 dictized_reply = dictize_and_check_retval(reply, err_msg)
                 ret_list.append(dictized_reply)