Omnibus fixes for running jobs on Noble with Python3.12

We bumped the default nodeset to ubuntu-noble which bumped our python
version up to python3.12. We were previously pinning hacking to a
version that pulls in a version of flake8 that isn't compatible with
python3.12 due to entrypoint importlib_metadata compatibility issues.

We fix that by updating hacking to lastest, but that introduces a new
rule that requires we have whitespace after a return statement. We also
fix that in the one location that was a problem.

Then separately ssl.wrap_context has been removed in python 3.12 so we
switch that out with SSLContext.wrap_context instead when checking irc
access in the irc access check job.

Change-Id: Id4e3c6f35ffcf5cea302aa1bd8b126affa4eeb07
This commit is contained in:
Clark Boylan 2024-08-21 10:01:31 -07:00
parent a346c106e6
commit dd63733b55
3 changed files with 9 additions and 3 deletions

View File

@ -91,7 +91,7 @@ def get_sha256(filename):
with open(filename, "rb") as f:
for b in iter(lambda: f.read(4096), b''):
sha256.update(b)
return(sha256.hexdigest())
return sha256.hexdigest()
def create_index(path, files):

View File

@ -142,7 +142,13 @@ def main():
for x in range(16))
port = int(args.port)
if port == 6697:
factory = irc.connection.Factory(wrapper=ssl.wrap_socket)
context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
# Set to false as the irc connection factory doesn't pass the
# server hostname into the wrapper which is required for hostname
# checking. Since this is just for testing risk is low.
context.check_hostname = False
context.verify_mode = ssl.CERT_NONE
factory = irc.connection.Factory(wrapper=context.wrap_socket)
a.connect(args.server, int(args.port), mynick,
connect_factory=factory)
else:

View File

@ -37,7 +37,7 @@ deps =
# pin these two until someone has time to update all our skips to >=6.16
ansible-lint>=6.0.0,<6.5.0
ansible-compat<4
hacking>=4.0.0,<5.0.0
hacking>=7.0.0,<8.0.0
bashate>=0.2
commands =
{toxinidir}/tools/ansible-lint-roles-cache.sh