Bug 155171

Summary: cups_import.which_spooler () in cups_import.py causes error "IndexError: list index out of range"
Product: [Fedora] Fedora Reporter: Carlo Wood <bugzilla>
Component: system-config-printerAssignee: Tim Waugh <twaugh>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-04-18 11:53:40 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:

Description Carlo Wood 2005-04-17 15:15:18 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

Description of problem:
When starting cups, either during boot or manually, I get:

/etc/rc.d/init.d>./cups start
Starting cups: Traceback (most recent call last):
  File "/usr/sbin/printconf-backend", line 7, in ?
    import backend
  File "/usr/share/printconf/util/backend.py", line 54, in ?
    which = cups_import.which_spooler ()
  File "/usr/share/printconf/util/cups_import.py", line 191, in which_spooler
    which = l.split ('.')[1].strip ()
IndexError: list index out of range


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

How reproducible:
Always

Steps to Reproduce:
1.Install the driver that comes with the Samsung ML-1520 laserprinter
2./etc/rc.d/init.d/cups start
3.
  

Actual Results:  See error in 'Description'

Expected Results:  No phyton 'trace' should be printed.

Additional info:

The reason for this is because there is no '.' in the investigated
output at that point.  In fact, in my case I have:

/etc/rc.d/init.d>LANG=C /usr/sbin/alternatives --display print | head -n 2
print - status is auto.
 link currently points to /usr/local/linuxprinter/bin/llpr

Where "/usr/local/linuxprinter/bin/llpr" is part of the "Linux Printer Package",
a driver that came with the Samsung ML-1520 laser printer (they support linux).

Since the result of which_spooler is only used to test
whether or not the CUPS queues need to be imported, I think that a
better, more generally robust, test can be easily performed.  Not
one that assumes a '.'.  For example, you could return 'Other' when
there is no '.'.

Here is the full out of /usr/sbin/alternatives --display print

print - status is auto.
 link currently points to /usr/local/linuxprinter/bin/llpr
/usr/bin/lpr.cups - priority 40
 slave print-cancel: /usr/bin/cancel.cups
 slave print-lp: /usr/bin/lp.cups
 slave print-lpq: /usr/bin/lpq.cups
 slave print-lprm: /usr/bin/lprm.cups
 slave print-lpstat: /usr/bin/lpstat.cups
 slave print-lpc: /usr/sbin/lpc.cups
 slave print-cancelman: /usr/share/man/man1/cancel-cups.1.gz
 slave print-lpman: /usr/share/man/man1/lp-cups.1.gz
 slave print-lpqman: /usr/share/man/man1/lpq-cups.1.gz
 slave print-lprman: /usr/share/man/man1/lpr-cups.1.gz
 slave print-lprmman: /usr/share/man/man1/lprm-cups.1.gz
 slave print-lpstatman: /usr/share/man/man1/lpstat-cups.1.gz
 slave print-lpcman: /usr/share/man/man8/lpc-cups.8.gz
/usr/local/linuxprinter/bin/llpr - priority 90
 slave print-cancel: /usr/bin/cancel.cups
 slave print-lp: /usr/local/linuxprinter/bin/llpr
 slave print-lpq: /usr/bin/lpq.cups
 slave print-lprm: /usr/bin/lprm.cups
 slave print-lpstat: /usr/bin/lpstat.cups
 slave print-lpc: /usr/sbin/lpc.cups
 slave print-cancelman: /usr/share/man/man1/cancel-cups.1.gz
 slave print-lpman: /usr/share/man/man1/lp-cups.1.gz
 slave print-lpqman: /usr/share/man/man1/lpq-cups.1.gz
 slave print-lprman: /usr/share/man/man1/lpr-cups.1.gz
 slave print-lprmman: /usr/share/man/man1/lprm-cups.1.gz
 slave print-lpstatman: /usr/share/man/man1/lpstat-cups.1.gz
 slave print-lpcman: /usr/share/man/man8/lpc-cups.8.gz
Current `best' version is /usr/local/linuxprinter/bin/llpr.

Comment 1 Tim Waugh 2005-04-18 11:53:40 UTC

*** This bug has been marked as a duplicate of 145904 ***