Repository :
http://git.fedorahosted.org/cgit/cura-tools.git
On branch : master
---------------------------------------------------------------
commit 99badf76124fab972309c7b64c432a37c71cc99a
Author: Peter Hatina <phatina(a)redhat.com>
Date: Fri Dec 6 13:30:00 2013 +0100
fix indication unique name
---------------------------------------------------------------
cli/lmi/shell/LMIIndicationListener.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/cli/lmi/shell/LMIIndicationListener.py
b/cli/lmi/shell/LMIIndicationListener.py
index 4f70e77..c8647bf 100644
--- a/cli/lmi/shell/LMIIndicationListener.py
+++ b/cli/lmi/shell/LMIIndicationListener.py
@@ -137,7 +137,7 @@ class LMIIndicationListener(object):
while True:
while handler_name_pattern[pattern_len - 1 - x_cnt] == "X":
x_cnt += 1
- if x_cnt < LMIIndicationListener.HANDLER_MINIMUM_REPL_CHARS_COUNT:
+ if x_cnt and x_cnt <
LMIIndicationListener.HANDLER_MINIMUM_REPL_CHARS_COUNT:
raise LMIHandlerNamePatternError("Not enough replaceable characters
provided")
unique_str = handler_name_pattern[:pattern_len - x_cnt] + \
"".join(random.choice(string.ascii_uppercase + string.digits)
for x in range(x_cnt))
@@ -219,7 +219,7 @@ class LMIIndicationListener(object):
:returns: handler unique name
:rtype: string
"""
- handler_name = self.__create_handler_name(handler_name_pattern + "X" *
16)
+ handler_name = self.__create_handler_name(handler_name_pattern)
self._handlers[handler_name] = LMIIndicationHandlerCallback(handler, *args,
**kwargs)
return handler_name