HomeClusterLabs Projects

Feature: python: Add a low level C-based python module wrapper.
3d8a15e190d3Unpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Feature: python: Add a low level C-based python module wrapper.

All the libpacemaker functions return an xmlNode **, which we need to
convert into some sort of native python type if we are to provide a
python module for people to use.

There's various ways we could go about doing this, but what we probably
want to be able to do is convert the C-based xmlNode ** type into
something that libxml2's python module can work with. Then, we can
write more of the python module in python itself instead of having to
work with libxml2 in C.

The way to do this is to write a small C-based wrapper function for each
libpacemaker function we want to expose in the python module, using the
PyCapsule type. These wrapper functions are likely to be pretty
formulaic - we could probably autogenerate them from a script if we
wanted.

This introduces a single function for demonstration purposes, plus the
rest of the boilerplate required to construct a python module in C.

Details

Provenance
clumensAuthored on Jan 28 2025, 1:45 PM
Parents
rPb312ae292dc5: Build: configure: Add python libraries and cflags.
Branches
Unknown
Tags
Unknown

Event Timeline