[Oval-commits] r167 - in trunk/oval-server: . OvalServer
Pavel Vinogradov
blaze-guest at alioth.debian.org
Mon Aug 20 11:42:09 UTC 2007
Author: blaze-guest
Date: 2007-08-20 11:42:09 +0000 (Mon, 20 Aug 2007)
New Revision: 167
Modified:
trunk/oval-server/OvalServer/OvalHttpServer.py
trunk/oval-server/oval-server.py
Log:
Remove hardcoded path
Modified: trunk/oval-server/OvalServer/OvalHttpServer.py
===================================================================
--- trunk/oval-server/OvalServer/OvalHttpServer.py 2007-08-20 11:37:25 UTC (rev 166)
+++ trunk/oval-server/OvalServer/OvalHttpServer.py 2007-08-20 11:42:09 UTC (rev 167)
@@ -6,8 +6,6 @@
class HttpRequestHandler (SimpleHTTPServer.SimpleHTTPRequestHandler):
- workdir = '/home/blaze/tmp/oval/server/definitions'
-
def do_QUIT (self):
"""send 200 OK response, and set server.stop to True"""
self.send_response(200)
@@ -20,7 +18,7 @@
client_ip = self.client_address[0]
if db.getAgentInfo(client_ip):
try:
- f = open (self.workdir+os.sep+client_ip+'.xml')
+ f = open (self.server.workdir+os.sep+client_ip+'.xml')
self.send_response(200)
self.send_header('Content-type', 'text/xml')
self.end_headers()
@@ -41,8 +39,10 @@
class OvalHttpServer (BaseHTTPServer.HTTPServer):
- def __init__(self, conf, handler, logger = None):
+ def __init__(self, conf, handler, workdir, logger = None):
BaseHTTPServer.HTTPServer.__init__ (self, conf, handler)
+ self.workdir = workdir
+
if logger:
self.logger = logger
else:
Modified: trunk/oval-server/oval-server.py
===================================================================
--- trunk/oval-server/oval-server.py 2007-08-20 11:37:25 UTC (rev 166)
+++ trunk/oval-server/oval-server.py 2007-08-20 11:42:09 UTC (rev 167)
@@ -23,7 +23,7 @@
if self.type == 'http':
from OvalServer.OvalHttpServer import OvalHttpServer, HttpRequestHandler
self.logger = logger
- self.server = OvalHttpServer ((self.ip, self.port), HttpRequestHandler, self.logger)
+ self.server = OvalHttpServer ((self.ip, self.port), HttpRequestHandler, self.workdir, self.logger)
self.logger.info('httpThread: Run local server on %s:%d in %s' % (self.ip, self.port, self.workdir))
else:
raise OvalServerNotSupported()
More information about the Oval-commits
mailing list