diff options
author | Fabian Affolter <fabian@bernewireless.net> | 2010-12-13 23:22:40 +0100 |
---|---|---|
committer | Fabian Affolter <fabian@bernewireless.net> | 2010-12-13 23:22:40 +0100 |
commit | f5792d907e357c90624ec110d908d42b94296a12 (patch) | |
tree | fc4976fb05c8d4026bc2580e48ad8070d85bd7c7 /build/lib/Bcfg2/Server/Plugins/__Web.py | |
parent | 18b3b41b3f993b2dd5a10e1bbb8abf959c57c4e2 (diff) | |
download | bcfg2-f5792d907e357c90624ec110d908d42b94296a12.tar.gz bcfg2-f5792d907e357c90624ec110d908d42b94296a12.tar.bz2 bcfg2-f5792d907e357c90624ec110d908d42b94296a12.zip |
Removed build files
Diffstat (limited to 'build/lib/Bcfg2/Server/Plugins/__Web.py')
-rw-r--r-- | build/lib/Bcfg2/Server/Plugins/__Web.py | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/build/lib/Bcfg2/Server/Plugins/__Web.py b/build/lib/Bcfg2/Server/Plugins/__Web.py deleted file mode 100644 index e1646e429..000000000 --- a/build/lib/Bcfg2/Server/Plugins/__Web.py +++ /dev/null @@ -1,47 +0,0 @@ -import os -import BaseHTTPServer -import SimpleHTTPServer -import Bcfg2.Server.Plugin - -# for debugging output only -import logging -logger = logging.getLogger('Bcfg2.Plugins.Web') - -class Web(Bcfg2.Server.Plugin.Plugin, - Bcfg2.Server.Plugin.Version): - """Web is a simple webserver to display the content of the Bcfg2 repos.""" - name = 'Web' - __version__ = '$Id$' - __author__ = 'bcfg-dev@mcs.anl.gov' - experimental = True - - def __init__(self, core, datastore): - Bcfg2.Server.Plugin.Plugin.__init__(self, core, datastore) - Bcfg2.Server.Plugin.Version.__init__(self) - self.core = core - self.datastore = datastore - - # Change directory to the Bcfg2 repo - ##path = '/home/fab/backup' - if not os.path.exists(datastore): - ##print "Path '%s' doesn't exisit" % datastore - logger.error("%s doesn't exist" % datastore) - raise Bcfg2.Server.Plugin.PluginInitError - else: - os.chdir(datastore) - self.start_web() - - logger.debug("Serving at port %s" % port) - - - def start_web(self, port=6788): - """Starts the webserver for directory listing of the Bcfg2 repo.""" - try: - server_class = BaseHTTPServer.HTTPServer - handler_class = SimpleHTTPServer.SimpleHTTPRequestHandler - server_address = ('', port) - server = server_class(server_address, handler_class) - server.serve_forever() - except: - logger.error("Failed to start webserver") - raise Bcfg2.Server.Plugin.PluginInitError |