Bug 1082019

Summary: IndexError when handler_name_pattern is composed only of "X" (lmi.shell.LMIIndicationListener)
Product: [Fedora] Fedora Reporter: Alois Mahdal <amahdal>
Component: openlmi-toolsAssignee: Peter Hatina <phatina>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: agk, miminar, phatina, tsmetana
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openlmi-tools-0.9.1-3.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-24 23:23:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alois Mahdal 2014-03-28 13:43:24 UTC
Description of problem:
When you provide only one or more "X" characters as handler_name_pattern when calling LMIIndicationListener.add_handler, IndexError("string index out of range") is raised from LMIIndicationListener.__create_handler_name


Version-Release number of selected component (if applicable):
openlmi-tools-0.9-16.fc20.noarch

How reproducible:
Always

Steps to Reproduce:
1. l = LMIIndicationListener(...)
2. l.handler("XX", ...)

Actual results:
IndexError("string index out of range")

Expected results:
If at least 8 "X" characters are given, unique name should be returned.
Otherwise, LMIHandlerNamePatternError should be raised.


Additional info:

In the offending code:

    while handler_name_pattern[pattern_len - 1 - x_cnt] == "X":
        x_cnt += 1

index is eventually -1.

Comment 1 Alois Mahdal 2014-03-28 13:47:28 UTC
Patch posted for review:

https://reviewboard-openlmi.rhcloud.com/r/1567/

Comment 2 Fedora Update System 2014-04-16 14:03:26 UTC
openlmi-tools-0.9.1-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/openlmi-tools-0.9.1-1.fc20

Comment 3 Fedora Update System 2014-04-18 15:43:31 UTC
Package openlmi-tools-0.9.1-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing openlmi-tools-0.9.1-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-5351/openlmi-tools-0.9.1-1.fc20
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2014-04-29 13:55:58 UTC
openlmi-tools-0.9.1-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/openlmi-tools-0.9.1-2.fc20

Comment 5 Fedora Update System 2014-05-15 07:45:20 UTC
openlmi-tools-0.9.1-3.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/openlmi-tools-0.9.1-3.fc20

Comment 6 Fedora Update System 2014-06-24 23:23:53 UTC
openlmi-tools-0.9.1-3.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.