summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Cmarada <mcmarada@cisco.com>2019-06-17 08:36:03 +0200
committerMichal Cmarada <mcmarada@cisco.com>2019-06-17 08:36:03 +0200
commitf3067ddaf1128e140471394b53e47b74da62cfa3 (patch)
treec77e87445f6687fe3fad799dae6c0cdaad18ce53
parente93de42b39d36722d8ffd294f81f904fe144046e (diff)
Skip CRC field for typesHEADmaster
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 <mcmarada@cisco.com>
-rwxr-xr-xjava/jvpp/gen/jvppgen/jvpp_model.py13
1 files changed, 7 insertions, 6 deletions
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):