c59e32469f
* Add new Fedora docker images with Python 3. * Use consistent env var for lookup test. * Fix testing of virtualenv with Python 3. * Fix docker_secret tests on Fedora 26. * Add Python 3 support to Fedora postgresql test. * Add Python 3 support to Fedora mysql tests. * Fix uri test server for Python 3 on Fedora. * Fix iso_extract test for Python 3 on Fedora. * Add Python 3 support for Fedora to openssl tests. * Fix dnf group test for Python 3 on Fedora. * Use force with user deletion in become test.
20 lines
570 B
Python
20 lines
570 B
Python
import sys
|
|
|
|
if __name__ == '__main__':
|
|
if sys.version_info[0] >= 3:
|
|
import http.server
|
|
import socketserver
|
|
PORT = int(sys.argv[1])
|
|
|
|
class Handler(http.server.SimpleHTTPRequestHandler):
|
|
pass
|
|
|
|
Handler.extensions_map['.json'] = 'application/json'
|
|
httpd = socketserver.TCPServer(("", PORT), Handler)
|
|
httpd.serve_forever()
|
|
else:
|
|
import mimetypes
|
|
mimetypes.init()
|
|
mimetypes.add_type('application/json', '.json')
|
|
import SimpleHTTPServer
|
|
SimpleHTTPServer.test()
|