Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
cobbler.2924
catch_cheetah_exception.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File catch_cheetah_exception.patch of Package cobbler.2924
Index: cobbler-2.4.0/bin/services.py =================================================================== --- cobbler-2.4.0.orig/bin/services.py +++ cobbler-2.4.0/bin/services.py @@ -24,6 +24,7 @@ # available at this point. import os import urllib +import xmlrpclib import cgi def application(environ, start_response): @@ -76,21 +77,25 @@ def application(environ, start_response) # Execute corresponding operation on the CobblerSvc object: func = getattr( cw, mode ) - content = func( **form ) + try: + content = func( **form ) - content = unicode(content).encode('utf-8') - status = '200 OK' - - if content.find("# *** ERROR ***") != -1: - status = '500 SERVER ERROR' - print("possible cheetah template error") + content = unicode(content).encode('utf-8') + status = '200 OK' - # TODO: Not sure these strings are the right ones to look for... - elif content.find("# profile not found") != -1 or \ - content.find("# system not found") != -1 or \ - content.find("# object not found") != -1: - print("content not found: %s" % my_uri) - status = "404 NOT FOUND" + if content.find("# *** ERROR ***") != -1: + status = '500 SERVER ERROR' + print("possible cheetah template error") + + # TODO: Not sure these strings are the right ones to look for... + elif content.find("# profile not found") != -1 or \ + content.find("# system not found") != -1 or \ + content.find("# object not found") != -1: + print("content not found: %s" % my_uri) + status = "404 NOT FOUND" + except xmlrpclib.Fault, (err): + status = '500 SERVER ERROR' + content = err.faultString # req.content_type = "text/plain;charset=utf-8" response_headers = [('Content-type', 'text/plain;charset=utf-8'),
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor