dns-ha - code not compatible with python3-yaml from jammy/antelope

Bug #2039724 reported by Piotr Ladynski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack HA Cluster Charm
New
Undecided
Unassigned

Bug Description

MAAS DNS driver is using yaml library from OS. In case of running the charm on node with jammy/antelope repository the python3-yaml is in 6.0 version. In that version yaml.load requires mandatory Loader argument (https://github.com/yaml/pyyaml/pull/561).

This can be fixed by either adding the Loader or replacing the method like below:

--- /usr/lib/heartbeat/maasclient/apidriver.py
+++ apidriver_safe.py
@@ -91,7 +91,7 @@

         code = response.getcode()
         if code == OK:
- return Response(True, yaml.load(payload), code)
+ return Response(True, yaml.safe_load(payload), code)
         else:
             return Response(False, payload, code)

@@ -107,7 +107,7 @@

             code = response.getcode()
             if code == OK:
- return Response(True, yaml.load(payload), code)
+ return Response(True, yaml.safe_load(payload), code)
             else:
                 return Response(False, payload, code)
         except HTTPError as e:

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.