Hello!
On Mon, Nov 28, 2022 at 03:08:59PM +0000, Stavros Konstantaras via Bird-users wrote:
And after closing the output file I proceed on calling subprocess with the "birdc configure" command.

You might consider sending the command directly to the control socket, e.g. (no error handling!):

```python
import socket

with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as sock:
     sock.connect('/run/bird/bird.ctl')
     sock.send(b'configure\n')
     # Assumption your config is under /etc/bird.conf
    assert sock.recv(4096) == b'0002-Reading configuration from /etc/bird.conf\n0003 Reconfigured\n'
```

This is horrible, yet understandable.

I hope we manage to include some machine-friendly control socket implementation in BIRD 3. It's gonna be based on CBOR format, hopefully distributed also with client Python libs, and if nobody in our team gets too angry with me for writing such a code, maybe also with an Ansible module allowing to write a nice-looking YAML definition.

Take this as my personal hopes … yet if you wanna say ±1 or whatever else to this, feel free to respond.

Maria

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to