mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-04 19:26:58 +00:00
straight up: ruff format (#11329)
* straight up: ruff format * Apply suggestions from code review
This commit is contained in:
parent
04d0a4daf3
commit
d549baa5e1
36 changed files with 438 additions and 396 deletions
|
|
@ -16,15 +16,17 @@ try:
|
|||
except ModuleNotFoundError:
|
||||
from http.server import HTTPServer, SimpleHTTPRequestHandler
|
||||
|
||||
httpd = HTTPServer(('localhost', port), SimpleHTTPRequestHandler)
|
||||
httpd = HTTPServer(("localhost", port), SimpleHTTPRequestHandler)
|
||||
try:
|
||||
httpd.socket = ssl.wrap_socket(httpd.socket, server_side=True,
|
||||
certfile=os.path.join(root_dir, 'cert.pem'),
|
||||
keyfile=os.path.join(root_dir, 'key.pem'))
|
||||
httpd.socket = ssl.wrap_socket(
|
||||
httpd.socket,
|
||||
server_side=True,
|
||||
certfile=os.path.join(root_dir, "cert.pem"),
|
||||
keyfile=os.path.join(root_dir, "key.pem"),
|
||||
)
|
||||
except AttributeError:
|
||||
# Python 3.12 or newer:
|
||||
context = ssl.create_default_context(purpose=ssl.Purpose.CLIENT_AUTH)
|
||||
context.load_cert_chain(certfile=os.path.join(root_dir, 'cert.pem'),
|
||||
keyfile=os.path.join(root_dir, 'key.pem'))
|
||||
context.load_cert_chain(certfile=os.path.join(root_dir, "cert.pem"), keyfile=os.path.join(root_dir, "key.pem"))
|
||||
httpd.socket = context.wrap_socket(httpd.socket)
|
||||
httpd.handle_request()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue