Bug 194433

Summary: [patch]printconf: browse_smb_hosts: local variable 'iter' referenced before assignment
Product: [Fedora] Fedora Reporter: Scott Tsai <scottt.tw>
Component: system-config-printerAssignee: Tim Waugh <twaugh>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5Keywords: Reopened
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-03-12 05:57:01 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
Assign "iter" to None before the loop, check it afterwards. none

Description Scott Tsai 2006-06-08 03:35:36 UTC
Description of problem:
When trying to browse for smb printers, 
/usr/share/printconf/util/addQueue.py prints out a python exception.

Version-Release number of selected component (if applicable):
system-config-printer-gui-0.6.151.7-1

How reproducible:
Always.
This will trigger when pysmb.get_domain_list() returns an empty dictionary.

Steps to Reproduce:
1. system-config-printer
2. "Action" -> "New Queue" -> queue type: "SMB"
  
Actual results:
prints out:
Traceback (most recent call last):
  File "/usr/share/printconf/util/addQueue.py", line 524, in type_menu_changed
    self.browse_smb_hosts ()
  File "/usr/share/printconf/util/addQueue.py", line 869, in browse_smb_hosts
    dummy = store.append (iter)
UnboundLocalError: local variable 'iter' referenced before assignment

on terminal.


Expected results:
No python programming errors.

Additional info:
Will attach a simple patch to fix this.

The util/addQueue.py file mixes Tabs and Spaces for indentation.
This can cause real bugs in the Python programming language.
Would you consider configuring your editor differently?

Does "printconf" have an upstream CVS or mailing list where I can help fix this
kind of bugs?

Comment 1 Scott Tsai 2006-06-08 03:35:36 UTC
Created attachment 130721 [details]
Assign "iter" to None before the loop, check it afterwards.

Comment 2 Tim Waugh 2006-06-20 13:26:41 UTC
Fixed in CVS.  Future FC5 updates should contain the fix.

FWIW, printconf has been entirely re-written as system-config-printer for Fedora
Core 6.

Comment 3 Tim Waugh 2006-08-16 11:25:40 UTC
Please try this test update:

https://www.redhat.com/archives/fedora-test-list/2006-August/msg00259.html

You should be able to get this using the command:

  yum --enablerepo=updates-testing update 'system-config-printer*'

as root.

Comment 4 Tim Waugh 2007-04-29 15:07:46 UTC
Reported confirms fix.