Check for messages with duplicate names inside a channel

Make sure there are not 2 messages with the same name in the
same channel.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
Frediano Ziglio 2018-05-14 23:12:03 +01:00
parent abdef4fd2a
commit e2f7a9235f

View File

@ -1055,6 +1055,8 @@ class ChannelType(Type):
m.value = info.count
info.count = m.value + 1
info.messages.append(m)
if m.name in info.messages_byname:
raise Exception("Duplicated message name '%s' in channel '%s'" % (m.name, self.name))
info.messages_byname[m.name] = m
self.server_messages = server_info.messages