1
0
mirror of https://github.com/ceph/ceph synced 2025-03-25 11:48:05 +00:00

admin/serve-doc: Switch to python3 only

Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
This commit is contained in:
Brad Hubbard 2020-02-28 15:25:17 +10:00
parent bb6ca5c2df
commit 8ccf43bce9

View File

@ -1,8 +1,9 @@
#!/usr/bin/python
#!/usr/bin/python3
from __future__ import print_function
import SimpleHTTPServer
import SocketServer
import http.server
import socketserver
import os
import sys
@ -11,7 +12,7 @@ os.chdir(path)
os.chdir('..')
os.chdir('build-doc/output/html')
class ReusingTCPServer(SimpleHTTPServer.SimpleHTTPRequestHandler):
class ReusingTCPServer(http.server.SimpleHTTPRequestHandler):
allow_reuse_address = True
def send_head(self):
@ -19,9 +20,9 @@ class ReusingTCPServer(SimpleHTTPServer.SimpleHTTPRequestHandler):
# slash-redirecting of requests with query arguments, and will
# redirect to /foo?q=bar/ -- wrong slash placement
self.path = self.path.split('?', 1)[0]
return SimpleHTTPServer.SimpleHTTPRequestHandler.send_head(self)
return http.server.SimpleHTTPRequestHandler.send_head(self)
httpd = SocketServer.TCPServer(
httpd = socketserver.TCPServer(
("", 8080),
ReusingTCPServer,
)