From 8366b24dd16b052d144218517381018bacdff1cf Mon Sep 17 00:00:00 2001 From: Oliver Palmer Date: Thu, 27 Mar 2014 01:03:20 -0400 Subject: [PATCH] rename --- pyfarm/agent/http/{index.py => system.py} | 24 ++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) rename pyfarm/agent/http/{index.py => system.py} (86%) diff --git a/pyfarm/agent/http/index.py b/pyfarm/agent/http/system.py similarity index 86% rename from pyfarm/agent/http/index.py rename to pyfarm/agent/http/system.py index c2349998..43f1351e 100644 --- a/pyfarm/agent/http/index.py +++ b/pyfarm/agent/http/system.py @@ -16,6 +16,7 @@ import time from datetime import timedelta +from httplib import OK import psutil from twisted.web.server import NOT_DONE_YET @@ -47,7 +48,7 @@ def get(self, request): # to the original request def cb(content): request.write(content) - request.setResponseCode(200) + request.setResponseCode(OK) request.finish() # convert the state integer to a string @@ -129,3 +130,24 @@ def cb(content): return NOT_DONE_YET + +class Configuration(Resource): + TEMPLATE = "configuration.html" + + def get(self, request): + # write out the results from the template back + # to the original request + def cb(content): + request.write(content) + request.setResponseCode(OK) + request.finish() + + configuration = [] + for key, value in sorted(config.items()): + configuration.append((key, value, None)) + + deferred = self.template.render( + configuration=configuration) + deferred.addCallback(cb) + + return NOT_DONE_YET \ No newline at end of file