mirror of
https://github.com/certbot/certbot.git
synced 2026-08-03 03:32:13 +02:00
Have letsencrypt-auto do a real upgrade in leauto-upgrades option 2 (#5390)
* Make leauto_upgrades do a real upgrade * Cleanup vars and output * Sleep until the server is ready * add simple_http_server.py * Use a randomly assigned port * s/realpath/readlink * wait for server before getting port * s/localhost/all interfaces
This commit is contained in:
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env python
|
||||
"""A version of Python 2.x's SimpleHTTPServer that flushes its output."""
|
||||
from BaseHTTPServer import HTTPServer
|
||||
from SimpleHTTPServer import SimpleHTTPRequestHandler
|
||||
import sys
|
||||
|
||||
def serve_forever(port=0):
|
||||
"""Spins up an HTTP server on all interfaces and the given port.
|
||||
|
||||
A message is printed to stdout specifying the address and port being used
|
||||
by the server.
|
||||
|
||||
:param int port: port number to use.
|
||||
|
||||
"""
|
||||
server = HTTPServer(('', port), SimpleHTTPRequestHandler)
|
||||
print 'Serving HTTP on {0} port {1} ...'.format(*server.server_address)
|
||||
sys.stdout.flush()
|
||||
server.serve_forever()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
kwargs = {}
|
||||
if len(sys.argv) > 1:
|
||||
kwargs['port'] = int(sys.argv[1])
|
||||
serve_forever(**kwargs)
|
||||
Reference in New Issue
Block a user