1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-03-22 05:09:12 +00:00

[PR #11048/ebf45260 backport][stable-12] remove conditional code for old snakes (#11050)

remove conditional code for old snakes (#11048)

* remove conditional code for old snakes

* remove conditional code for old snakes

* reformat

* add changelog frag

(cherry picked from commit ebf45260ce)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2025-11-08 20:55:09 +01:00 committed by GitHub
parent 16f1d07509
commit caebf65948
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 26 additions and 105 deletions

View file

@ -6,18 +6,12 @@
from __future__ import annotations
import sys
import http.server
import socketserver
if __name__ == '__main__':
if sys.version_info[0] >= 3:
import http.server
import socketserver
PORT = int(sys.argv[1])
Handler = http.server.SimpleHTTPRequestHandler
httpd = socketserver.TCPServer(("", PORT), Handler)
httpd.serve_forever()
else:
import mimetypes
mimetypes.init()
mimetypes.add_type('application/json', '.json')
import SimpleHTTPServer
SimpleHTTPServer.test()
PORT = int(sys.argv[1])
Handler = http.server.SimpleHTTPRequestHandler
httpd = socketserver.TCPServer(("", PORT), Handler)
httpd.serve_forever()

View file

@ -7,19 +7,15 @@
from __future__ import annotations
import sys
from xmlrpc.client import ServerProxy
from urllib.parse import quote
proc = sys.argv[1]
value = sys.argv[2]
username = sys.argv[3]
password = sys.argv[4]
if sys.version_info[0] == 2:
from xmlrpclib import ServerProxy
from urllib import quote
else:
from xmlrpc.client import ServerProxy
from urllib.parse import quote
if username:
url = 'http://%s:%s@127.0.0.1:9001/RPC2' % (quote(username, safe=''), quote(password, safe=''))
else: