From: Vratko Polak Date: Mon, 15 Mar 2021 09:02:45 +0000 (+0100) Subject: API options: Fix case when no options are present X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=commitdiff_plain;h=1d84dc8e8f916bb0854e80e60bad1006d8d7be25;hp=eb19fb2a7ce7c3a40e3a1a3042a15b0d728e4784 API options: Fix case when no options are present In that case we want to pass by returning an empty dict, as docstring already describes. Before this, the code failed when checking for included version. Change-Id: Ia0d6b81a64ad0e7027ac7daf15c72ace1f6982ce Signed-off-by: Vratko Polak --- diff --git a/resources/libraries/python/VppApiCrc.py b/resources/libraries/python/VppApiCrc.py index 94e2690d8b..1fcb91d4b9 100644 --- a/resources/libraries/python/VppApiCrc.py +++ b/resources/libraries/python/VppApiCrc.py @@ -197,8 +197,8 @@ class VppApiCrcChecker: for item in reversed(msg_obj): if not isinstance(item, dict): continue - options = item.get(u"options", None) - if options is not None: + options = item.get(u"options", dict()) + if not options: break if version is None or version.startswith(u"0."): options[u"version"] = version