Skip to content

Commit

Permalink
fix: Add get_connection_with_tls_context() for requests 2.32.2+ (#5435)
Browse files Browse the repository at this point in the history
get_connection() is deprecated in requests 2.32.2+ so this will
allow for the LXDSocketAdapter to avoid using a deprecated api.

Fixes GH-5434

Signed-off-by: eaglegai <eaglegai@163.com>
  • Loading branch information
eaglegai authored and holmanb committed Jun 28, 2024
1 parent dcdc8ac commit 960c570
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cloudinit/sources/DataSourceLXD.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ class LXDSocketAdapter(HTTPAdapter):
def get_connection(self, url, proxies=None):
return SocketConnectionPool(LXD_SOCKET_PATH)

# Fix for requests 2.32.2+:
# https://github.com/psf/requests/pull/6710
def get_connection_with_tls_context(
self, request, verify, proxies=None, cert=None
):
return self.get_connection(request.url, proxies)


def _raw_instance_data_to_dict(metadata_type: str, metadata_value) -> dict:
"""Convert raw instance data from str, bytes, YAML to dict
Expand Down
1 change: 1 addition & 0 deletions tools/.github-cla-signers
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ dermotbradley
dhalturin
dhensby
Dorthu
eaglegai
eandersson
eb3095
ederst
Expand Down

0 comments on commit 960c570

Please sign in to comment.