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

Bug #2039724 reported by Piotr Ladynski
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack HA Cluster Charm
Status tracked in Trunk
Jammy
Triaged
High
Unassigned
Trunk
Triaged
High
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:

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

Yes, agreed. The files/ocf/maas/maasclient/apidriver.py should be updated to use yaml.safe_load().

Changed in charm-hacluster:
importance: Undecided → High
status: New → Triaged
tags: added: good-first-bug
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.