ctdb client python bindings

John Mulligan phlogistonjohn at asynchrono.us
Thu Apr 28 18:20:36 UTC 2022

On Thursday, April 28, 2022 11:03:54 AM EDT Andrew Walker via samba-technical 
> On Thu, Apr 28, 2022 at 4:14 AM Amitay Isaacs <amitay at gmail.com> wrote:
> > I appreciate the efforts to implement python bindings for ctdb client
> > interfaces.  However, I fail to understand the motivation behind this
> > work.  Is there a requirement from some applications to have a python
> > interface to CTDB?  Or do you have some other plans?
> Well, I was working on this because our own (truenas) has python-based
> middleware and I was wanting to be able to get ctdb status info without
> having to launch subprocesses. I was also planning to write python-based
> collectd plugin to gather stats from ctdb at configurable intervals.

I'll second the desire for python bindings for samba functionality that, while 
doable by running CLI tools and scraping their output, are more elegant and 
efficient when using an API.  Specifically, I'd (probably) also be able to make 
use of these CTDB related APIs in my code.

> > In the past, Martin and I had considered developing python bindings
> > for client interfaces.  The motivation there was to rewrite the ctdb
> > tool in python. However, we never got around to doing that.
> That's a good idea. I could go that route, which would reduce code
> duplication. Basically keep existing behaviors and arguments for ctdb tool,
> but have it be python tool. Then it will probably not increase maintenance
> load.

May I humbly suggest that re-implementing the ctdb CLI not be a strict 
requirement to adding useful Python APIs.  There's been a number of cases with 
regards to Samba where a small-enough task suddenly gets bigger in scope and 
then either takes a very long time to get merged (if ever).

More information about the samba-technical mailing list