Univention Bugzilla – Attachment 8053 Details for
Bug 41374
Printermoderation fails on restricted printers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch2
41374.patch (text/plain), 1.60 KB, created by
Florian Best
on 2016-09-29 15:08:29 CEST
(
hide
)
Description:
patch2
Filename:
MIME Type:
Creator:
Florian Best
Created:
2016-09-29 15:08:29 CEST
Size:
1.60 KB
patch
obsolete
>diff --git a/ucs-school-umc-printermoderation/umc/python/printermoderation/__init__.py b/ucs-school-umc-printermoderation/umc/python/printermoderation/__init__.py >index a9dd65e..78a1f17 100644 >--- a/ucs-school-umc-printermoderation/umc/python/printermoderation/__init__.py >+++ b/ucs-school-umc-printermoderation/umc/python/printermoderation/__init__.py >@@ -231,7 +231,7 @@ class Instance(SchoolBaseModule): > raise UMC_Error(_('Invalid printer URI')) > > if not os.path.exists(path): >- raise UMC_Error(_('File %r could not be printed as it does not exists (anymore).') % (printjob,)) >+ raise UMC_Error(_('File %r could not be printed as it does not exists (anymore).') % (printjob,)) > > MODULE.process('Printing: %s' % path) > self.pw_callback_bad_password = False >@@ -243,8 +243,13 @@ class Instance(SchoolBaseModule): > conn.printFile(printer, path, Printjob.filename2label(printjob), {}) > except RuntimeError: > raise UMC_Error(_('Failed to connect to print server %(printserver)s.') % {'printserver': spoolhost}) >- except cups.IPPError as e: >- raise UMC_Error(_('Failed to print on %(printer)s: %(stderr)s') % {'printer': printer, 'stderr': e}) >+ except cups.IPPError as (errno, description): >+ IPP_AUTHENTICATION_CANCELED = 4096 >+ description = { >+ cups.IPP_NOT_AUTHORIZED: _('No permission to print'), >+ IPP_AUTHENTICATION_CANCELED: _('Wrong password'), >+ }.get(errno, description) >+ raise UMC_Error(_('Failed to print on %(printer)s: %(stderr)s (error %(errno)d).') % {'printer': printer, 'stderr': description, 'errno': errno}) > > # delete file > MODULE.info('Deleting print job %r' % (path,))
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 41374
:
7942
| 8053