Bug 1069832

Summary: [abrt] system-switch-java: switch_java_functions.py:138:get_java_identifiers:UnboundLocalError: local variable 'best_identifier_index' referenced before assignment
Product: [Fedora] Fedora Reporter: Evgeniy Gurevich <godlike_devil>
Component: system-switch-javaAssignee: Omair Majid <omajid>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: dbhole, iliketurtlesbro, omajid, sc1.bugzilla.redhat
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/6d14e6266665039d7fdcdaa68000b00ceaeed97a
Whiteboard: abrt_hash:11d079306037c24036e2f319bd157420f36ac1b7
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-25 19:33:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: environ none

Description Evgeniy Gurevich 2014-02-25 18:04:17 UTC
Description of problem:
Just installed SUN JDK

Version-Release number of selected component:
system-switch-java-1.1.5-8.fc20

Additional info:
reporter:       libreport-2.1.12
cmdline:        python /usr/sbin/system-switch-java
executable:     /usr/sbin/system-switch-java
kernel:         3.13.3-201.fc20.x86_64
runlevel:       N 5
type:           Python
uid:            0

Truncated backtrace:
switch_java_functions.py:138:get_java_identifiers:UnboundLocalError: local variable 'best_identifier_index' referenced before assignment

Traceback (most recent call last):
  File "/usr/sbin/system-switch-java", line 89, in <module>
    main()
  File "/usr/sbin/system-switch-java", line 50, in main
    java_identifiers, best_identifier = get_java_identifiers()
  File "/usr/share/system-switch-java/switch_java_functions.py", line 138, in get_java_identifiers
    best_identifier = identifiers_and_jdks[best_identifier_index][0]
UnboundLocalError: local variable 'best_identifier_index' referenced before assignment

Local variables in innermost frame:
jre_search: None
java: None
identifiers_and_jdks: [('1.7.0-openjdk-1.7.0.60-2.4.5.1.fc20.x86_64', True)]
i: 1
alternatives: ['/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.5.1.fc20.x86_64/jre/bin/java', '/usr/java/jdk1.7.0_51/jre/bin/java']
jre_expression: <_sre.SRE_Pattern object at 0x200c9e0>
jdk_expression: <_sre.SRE_Pattern object at 0x203f500>
best: 1
best_identifier: None
jdks: [True]
best_indentifier_index: -1
alternative: '/usr/java/jdk1.7.0_51/jre/bin/java'
jdk_search: None
java_identifiers: ['1.7.0-openjdk-1.7.0.60-2.4.5.1.fc20.x86_64']

Comment 1 Evgeniy Gurevich 2014-02-25 18:04:22 UTC
Created attachment 867571 [details]
File: backtrace

Comment 2 Evgeniy Gurevich 2014-02-25 18:04:24 UTC
Created attachment 867572 [details]
File: environ

Comment 3 Omair Majid 2014-02-25 19:33:43 UTC
system-switch-java supports Fedora and JPackage-style JDKs. The rpms published by Oracle do not follow these guidelines and can not be supported by system-switch-java.

You should still be able to configure things using the `alternatives` command directly.