[Pacemaker] python bindings

Dejan Muhamedagic dejanmm at fastmail.fm
Tue Jul 7 16:28:43 UTC 2009


Hi,

On Tue, Jul 07, 2009 at 02:39:31PM +0200, Nikola Ciprich wrote:
> Hello,
> I would like to do some extensive scripting with python and pacemaker. 
> According to what I've discovered so far, it seems that there are at least
> two implemented python "bindings" - one in Dejan's crm shell and one in
> Yan's mgmt package. I'm wandering if it maybe might make sense to start
> project on creating separate set of python bindings which could be usable
> by both those projects as well as others.

That would be great, of course. I talked to Yan about it a bit,
but we didn't get further than agreeing that it would be of
benefit to have common python library (or bindings, as you put
it).

The GUI is quite a bit older than the crm shell and it supports
the older Heartbeat v2 CIB format. Though there was a lot of new
development in the GUI as well. Now, the two have different
access patterns: the crm talks to the cib (the daemon) using
cibadmin whereas the GUI accesses the CIB over the network
through mgmtd. I don't know the protocol details. BTW, the cib
also has network capabilities, so it's possible to use the crm
shell or cibadmin or crm_resource from a remote host (but I never
tried that).

> In such case, what would be the best way of creating those bindings? 

I guess first by identifying the needs, then to devise the
interface, finally to analyze the existing code and see how the
interface fits, then to redesign interface :)

> I'm considering either reusing the existing code (either from crm, or mgmt)
> or creating it from scratch...

Probably some parts can be reused.

> And is it better to use mgmt interface, or rather parse commands output? (I 
> don'r really like the latter variant)

The mgmtd should sometimes in future be converted to use the crm
shell interface. When you say "parse output" to which output do
you refer?

> Anyways, any suggestion would be appreciated!

Not a python expert here, so I'm all ears to hear about possible
improvements.

Thanks,

Dejan


> thanks!
> nik
> 
> -- 
> -------------------------------------
> Nikola CIPRICH
> LinuxBox.cz, s.r.o.
> 28. rijna 168, 709 01 Ostrava
> 
> tel.:   +420 596 603 142
> fax:    +420 596 621 273
> mobil:  +420 777 093 799
> www.linuxbox.cz
> 
> mobil servis: +420 737 238 656
> email servis: servis at linuxbox.cz
> -------------------------------------
> 
> _______________________________________________
> Pacemaker mailing list
> Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker




More information about the Pacemaker mailing list