diff options
-rw-r--r-- | cobbler/services.py | 13 | ||||
-rwxr-xr-x | scripts/services.py | 7 |
2 files changed, 16 insertions, 4 deletions
diff --git a/cobbler/services.py b/cobbler/services.py index 9b76f69c..882bf7c5 100644 --- a/cobbler/services.py +++ b/cobbler/services.py @@ -305,13 +305,22 @@ def test_services_access(): url = "http://127.0.0.1/cblr/svc/op/ks/profile/profile0" data = urlgrabber.urlread(url) - print "DATA1: %s" % data assert data.find("look_for_this1") != -1 url = "http://127.0.0.1/cblr/svc/op/ks/system/system0" data = urlgrabber.urlread(url) - print "DATA2: %s" % data assert data.find("look_for_this2") != -1 + # see if we can pull up the yum configs + url = "http://127.0.0.1/cblr/svc/op/yum/profile/profile0" + data = urlgrabber.urlread(url) + print "D1=%s" % data + assert data.find("repo0") != -1 + + url = "http://127.0.0.1/cblr/svc/op/yum/system/system0" + data = urlgrabber.urlread(url) + print "D2=%s" % data + assert data.find("repo0") != -1 + remote._test_remove_objects() diff --git a/scripts/services.py b/scripts/services.py index 4b77b2da..5d5c16f3 100755 --- a/scripts/services.py +++ b/scripts/services.py @@ -91,11 +91,14 @@ def handler(req): if content.find("# *** ERROR ***") != -1: req.write(content) + apache.log_error("possible cheetah template error") return apache.HTTP_ERROR - elif content.find("# profile not found") != -1 or content.find("# system not found") != -1: + elif content.find("# profile not found") != -1 or content.find("# system not found") != -1 or content.find("# object not found") != -1: req.content_type = "text/html;charset=utf-8" + req.write(" ") + apache.log_error("content not found") return apache.HTTP_NOT_FOUND else: req.write(content) - return apache.HTTP_OK + return apache.OK |