From 9311e066f1eafea68fc714183173d8a5cc197d73 Mon Sep 17 00:00:00 2001
From: James Falcon <james.falcon@canonical.com>
Date: Mon, 3 Mar 2025 13:27:50 -0600
Subject: [PATCH] fix: Update OauthUrlHelper to use readurl exception_cb
 signature

Fixes GH-6065
Bug: https://github.com/canonical/cloud-init/issues/6065
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/2100963
---
 cloudinit/url_helper.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/cloudinit/url_helper.py
+++ b/cloudinit/url_helper.py
@@ -1035,7 +1035,7 @@ class OauthUrlHelper:
         ) as fp:
             fp.write(json.dumps(cur))
 
-    def exception_cb(self, msg, exception):
+    def exception_cb(self, exception):
         if not (
             isinstance(exception, UrlError)
             and (exception.code == 403 or exception.code == 401)
@@ -1096,13 +1096,13 @@ class OauthUrlHelper:
     def readurl(self, *args, **kwargs):
         return self._wrapped(readurl, args, kwargs)
 
-    def _exception_cb(self, extra_exception_cb, msg, exception):
+    def _exception_cb(self, extra_exception_cb, exception):
         ret = None
         try:
             if extra_exception_cb:
-                ret = extra_exception_cb(msg, exception)
+                ret = extra_exception_cb(exception)
         finally:
-            self.exception_cb(msg, exception)
+            self.exception_cb(exception)
         return ret
 
     def _headers_cb(self, extra_headers_cb, url):
