From f3067ddaf1128e140471394b53e47b74da62cfa3 Mon Sep 17 00:00:00 2001 From: Michal Cmarada Date: Mon, 17 Jun 2019 08:36:03 +0200 Subject: Skip CRC field for types VPP doesn't include crc field in types anymore, therefore we need to skip check if it exists. Change-Id: I1c6c7b72f22524387c15728b795d342011770c60 Signed-off-by: Michal Cmarada --- java/jvpp/gen/jvppgen/jvpp_model.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'java') diff --git a/java/jvpp/gen/jvppgen/jvpp_model.py b/java/jvpp/gen/jvppgen/jvpp_model.py index 1b406ba..376a5fa 100755 --- a/java/jvpp/gen/jvppgen/jvpp_model.py +++ b/java/jvpp/gen/jvppgen/jvpp_model.py @@ -514,12 +514,12 @@ class JVppModel(object): def _parse_union(self, name, definition): self.logger.debug("Parsing union %s: %s", name, definition) - crc, fields = self._parse_fields(definition) + crc, fields = self._parse_fields(definition, data_type="union") return Union(name, crc, fields, definition, self.plugin_name) def _parse_type(self, name, definition): self.logger.debug("Parsing type %s: %s", name, definition) - crc, fields = self._parse_fields(definition) + crc, fields = self._parse_fields(definition, data_type="type") return Class(name, crc, fields, definition, self.plugin_name) def _parse_services(self): @@ -544,7 +544,7 @@ class JVppModel(object): def _parse_message(self, name, definition): self.logger.debug("Parsing message %s: %s", name, definition) - crc, fields = self._parse_fields(definition) + crc, fields = self._parse_fields(definition, data_type="message") if name in self._services: service = self._services[name] reply = service['reply'] @@ -563,7 +563,7 @@ class JVppModel(object): # Throw exception instead (requires fixing vppagigen). return Event(name, crc, filter(_is_request_field, fields), definition) - def _parse_fields(self, definition): + def _parse_fields(self, definition, data_type): crc = None fields = [] for item in definition: @@ -571,8 +571,9 @@ class JVppModel(object): crc = item['crc'] else: fields.append(self._parse_field(item, fields)) - if not crc: - raise ParseException("CRC was not defined for %s" % definition) + if "message" in data_type: + if not crc: + raise ParseException("CRC was not defined for %s" % definition) return crc, fields def _parse_field(self, field, fields): -- cgit 1.2.3-korg