From e1f4850b2b54f5b1878b5ad322cdb5eeb83f4cf7 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 26 Sep 2018 18:50:11 +0100 Subject: [PATCH] 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. --- v2v/test-v2v-o-rhv-upload-module/ovirtsdk4/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/v2v/test-v2v-o-rhv-upload-module/ovirtsdk4/__init__.py b/v2v/test-v2v-o-rhv-upload-module/ovirtsdk4/__init__.py index 8d1058d67..2f44c00da 100644 --- a/v2v/test-v2v-o-rhv-upload-module/ovirtsdk4/__init__.py +++ b/v2v/test-v2v-o-rhv-upload-module/ovirtsdk4/__init__.py @@ -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()