From 99badf76124fab972309c7b64c432a37c71cc99a Mon Sep 17 00:00:00 2001 From: Peter Hatina Date: Fri, 6 Dec 2013 13:30:00 +0100 Subject: [PATCH 2/2] fix indication unique name --- cli/lmi/shell/LMIIndicationListener.py | 4 ++-- 1 file 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 -- Peter Hatina ENG Server Experience, System Management Red Hat Czech, Brno