Question for anyone more clued in than me . . . I am new to ExaBGP. I am a fairly competent Python programmer, but wouldn't classify myself as an expert per se.
Non-blocking reads from stdin is new to me, I don't typically code this type of application. I've managed to cobble together the following code to run commands/get output:
https://gist.github.com/microlinux/cd7ddeff3a715d2fbea827ffca2b4e76
My current need for ExaBGP is relatively simple, I would like to peer with upstream blackhole servers to issue null routes. I need to announce routes and view the outgoing RIB.
Using the aforementioned code, announcing routes seems to work as intended. I issue the command and receive a 'done' response every time.
Where I am running into trouble is when I run the command 'show adj-rib out'. Sometimes I receive a response of 'done', and that's it. There are routes in the RIB, but they don't get captured - I just receive 'done'. Other times, I don't capture any response, even 'done'. Most of the time, however, I am capturing the output as intended.
Through debugging, I have noticed that when this happens, it seems I capture the "missing" output after running another command. Which makes me think there is something wrong with the code that reads stdin.
Any Python experts out there that can point out what I might be doing wrong? I don't discount the possibility my code is horribly out of whack given my lack of experience in this area.
Thanks for any help!