mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
RHEL 7: v2v: -o rhv-upload: Use Python 2 instead of Python 3.
For RHEL 7.6 LP only, this is a further change required for Python 2 support. See also these commits: "RHEL 7: -o rhv-upload: Use Python 2 instead of Python 3." + the preceeding 4 commits to this one.
This commit is contained in:
committed by
Pino Toscano
parent
69f181715f
commit
e1f4850b2b
@@ -112,10 +112,11 @@ class VmsService(object):
|
||||
# Create a background thread running a web server which is
|
||||
# simulating the imageio server.
|
||||
|
||||
from http.server import HTTPServer, BaseHTTPRequestHandler
|
||||
import SimpleHTTPServer
|
||||
import SocketServer
|
||||
import threading
|
||||
|
||||
class RequestHandler(BaseHTTPRequestHandler):
|
||||
class RequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||
protocol_version = 'HTTP/1.1'
|
||||
|
||||
def do_OPTIONS(self):
|
||||
@@ -154,11 +155,12 @@ class RequestHandler(BaseHTTPRequestHandler):
|
||||
server_address = ("", 0)
|
||||
# XXX This should test HTTPS, not HTTP, because we are testing a
|
||||
# different path through the main code.
|
||||
httpd = HTTPServer(server_address, RequestHandler)
|
||||
httpd = SocketServer.TCPServer(server_address, RequestHandler)
|
||||
imageio_port = httpd.server_address[1]
|
||||
|
||||
def server():
|
||||
httpd.serve_forever()
|
||||
|
||||
thread = threading.Thread(target = server, args = [], daemon = True)
|
||||
thread = threading.Thread(target = server, args = [])
|
||||
thread.daemon = True
|
||||
thread.start()
|
||||
|
||||
Reference in New Issue
Block a user