VPP-1144: PAPI Import leads to duplicate type definition.
Change-Id: I54c147004fd93681a6a9cf30fa5277c1dabce67c Signed-off-by: Ole Troan <ot@cisco.com>
This commit is contained in:
@ -515,8 +515,23 @@ class VPP():
|
||||
return self.messages[name]['return_tuple']
|
||||
return None
|
||||
|
||||
def duplicate_check_ok(self, name, msgdef):
|
||||
crc = None
|
||||
for c in msgdef:
|
||||
if type(c) is dict and 'crc' in c:
|
||||
crc = c['crc']
|
||||
break
|
||||
if crc:
|
||||
# We can get duplicates because of imports
|
||||
if crc == self.messages[name]['crc']:
|
||||
return True
|
||||
return False
|
||||
|
||||
def add_message(self, name, msgdef, typeonly=False):
|
||||
if name in self.messages:
|
||||
if typeonly:
|
||||
if self.duplicate_check_ok(name, msgdef):
|
||||
return
|
||||
raise ValueError('Duplicate message name: ' + name)
|
||||
|
||||
args = collections.OrderedDict()
|
||||
|
Reference in New Issue
Block a user