Bug 88291 - redhat-config-printer fails to write CUPS files
redhat-config-printer fails to write CUPS files
Status: CLOSED ERRATA
Product: Red Hat Linux
Classification: Retired
Component: redhat-config-printer (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
:
: 92083 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-04-08 12:12 EDT by Christopher Wong
Modified: 2007-04-18 12:52 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-07-07 12:36:35 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Christopher Wong 2003-04-08 12:12:03 EDT
Description of problem:

redhat-config-printer fails to write CUPS files after applying changes. Subsequent running of the program shows the changes I selected, but the files in /etc/cups (cupsd.conf, printers.conf) do not reflect the changes.

I tried running "printconf-backend --force-rebuild" to see if it would update the files, but I got the following error message:

Traceback (most recent call last):
  File "/usr/sbin/printconf-backend", line 7, in ?
    import backend
  File "/usr/share/printconf/util/backend.py", line 762, in ?
    (ipaddr, broadcast) = grok_sysconfig_files (interfaces)
  File "/usr/share/printconf/util/backend.py", line 644, in grok_sysconfig_files
    network = "NETWORK=%s.%s.%s.%s\n" % quad[:4]
UnboundLocalError: local variable 'quad' referenced before assignment

How reproducible:

This is a fresh install of Red Hat 9. I had created a local print queue and several remote ones. I had also hand-edited /etc/cups/cupsd.conf before discovering that this file would get overwritten. Finally, I fired up redhat-config-printer again and edited the sharing settings for the local print queue, specifying a network address of 192.168.0.0/255.255.255.0. On checking cupsd.conf at this point, I found that no changes were being saved.
Comment 1 Tim Waugh 2003-04-08 12:26:10 EDT
Oops.  Please add 'quad = match.groups ()' above that line and see if that helps.
Comment 2 Christopher Wong 2003-04-08 12:48:57 EDT
That "quad = match.groups()" fix works. Thanks.
Comment 3 Tim Waugh 2003-06-02 12:21:18 EDT
*** Bug 92083 has been marked as a duplicate of this bug. ***
Comment 4 Ross Johnson 2003-06-03 10:16:11 EDT
I get a different traceback when I run the following commands:

# redhat-config-printer-tui --Ximport < exported.xml
# printconf-backend --force-rebuild
Traceback (most recent call last):
  File "/usr/sbin/printconf-backend", line 7, in ?
    import backend
  File "/usr/share/printconf/util/backend.py", line 763, in ?
    (ipaddr, broadcast) = grok_sysconfig_files (interfaces)
  File "/usr/share/printconf/util/backend.py", line 619, in grok_sysconfig_files
   quad[2] = '255'
TypeError: object doesn't support item assignment

I live in a 137.92.0.0 address domain so this is the first line that attempts to
do an assignment.

I think I fixed it with:

        if match:
            ipaddr.append (each)
            quad = match.groups ()
            bcast = quad[0]
            bcast += '.'
            if int (quad[0]) < 128:
                bcast += '255'
            else:
                bcast += quad[1]
                                                                                
            bcast += '.'
            if int (quad[0]) < 192:
                bcast += '255'
            else:
                bcast += quad[2]
                                                                                
            bcast += '.'
            bcast += '255'
            broadcast.append (bcast)
            continue
 
Comment 5 Tim Waugh 2003-06-03 11:36:48 EDT
Thanks.  I've used your approach to fix this in 0.6.61-1 in rawhide.
Comment 6 Tim Waugh 2003-07-07 12:36:35 EDT
An errata has been issued which should help the problem described in this bug report. 
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen 
this bug report if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2003-125.html
Comment 7 Evan Chang 2004-06-23 12:47:21 EDT
printconf_tui.pyo
Comment 8 Evan Chang 2004-06-23 13:28:59 EDT
Reason:
1.redhat-config-printer tool cannot create cups.* file correctly 
after I modify /etc/cups/cups.conf by vi. Due to I found an un-
erasiable print-device in samba server.
2. But , cups.* file could be created correctly by " printconf-
backend --force-rebuild " command .

Action:
1. mv /usr/share/printconf /usr/share/printconf.backup
2. rpm -Uhv --force redhat-config-printer-0.6.47-1.i386.rpm ; that 
means reinstall it 
3. the redhat-config-printer tool cannot create cups.* file correctly
4. I found that the /usr/share/printconf/util/printconf_tui.pyo 
does't be created.

Solution:
Copy a file from another RedHat 9 machine . All system working well.

Question:
How to generate printconf_tui.pyo by printconf_tui.py in the same 
machine ?
Comment 9 Tim Waugh 2004-06-28 05:42:32 EDT
Evan: it's not clear to me what you mean.  Please file a separate bug
report and include all error messages you get (in full).  Thanks.

Note You need to log in before you can comment on or make changes to this bug.