diff options
author | Frediano Ziglio <fziglio@redhat.com> | 2018-05-14 23:12:03 +0100 |
---|---|---|
committer | Frediano Ziglio <fziglio@redhat.com> | 2018-05-23 10:31:30 +0100 |
commit | e2f7a9235f111fa07b4978b1fe809087c4dcc2f4 (patch) | |
tree | 2e7711430e75450eff1b4f1adc70f98ff620731c /python_modules | |
parent | abdef4fd2a4be5c5d363cda2b2838a1f7cc4899d (diff) |
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>
Diffstat (limited to 'python_modules')
-rw-r--r-- | python_modules/ptypes.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/python_modules/ptypes.py b/python_modules/ptypes.py index 631739e..916ba50 100644 --- a/python_modules/ptypes.py +++ b/python_modules/ptypes.py @@ -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 |