The efi-pxeboot test can crash because of an unassigned variable

Bug #1777738 reported by Rod Smith
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox Provider - Base
Fix Released
Medium
Rod Smith

Bug Description

See:

https://certification.canonical.com/hardware/201706-25573/submission/130689/

Specifically:

Traceback (most recent call last):
  File "/tmp/nest-grcrabbc.ddffe1464fb1472263c562eaa13feeb6fd7958c5aef597cea6e3f81f7455786c/efi-pxeboot", line 149, in <module>
    sys.exit(main())
  File "/tmp/nest-grcrabbc.ddffe1464fb1472263c562eaa13feeb6fd7958c5aef597cea6e3f81f7455786c/efi-pxeboot", line 133, in main
    boot_entries, boot_order, boot_current = discover_data()
  File "/tmp/nest-grcrabbc.ddffe1464fb1472263c562eaa13feeb6fd7958c5aef597cea6e3f81f7455786c/efi-pxeboot", line 78, in discover_data
    return boot_entries, boot_order, boot_current
UnboundLocalError: local variable 'boot_current' referenced before assignment

The exception is tripped on the function's return line. The fix should be easy -- assign all three of the variables the function returns to empty strings before the if/elif/then clauses, to ensure all three have values.

Rod Smith (rodsmith)
tags: added: hwcert-server
Rod Smith (rodsmith)
Changed in plainbox-provider-checkbox:
assignee: nobody → Rod Smith (rodsmith)
importance: Undecided → Medium
status: New → Fix Committed
Changed in plainbox-provider-checkbox:
milestone: none → 0.46.0
Rod Smith (rodsmith)
Changed in plainbox-provider-checkbox:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.