czerwonk / junos_exporter

Exporter for devices running JunOS to use with https://prometheus.io/
MIT License
198 stars 81 forks source link

Move <rpc-reply> unpacking to RPC client #215

Open Nothing4You opened 1 year ago

Nothing4You commented 1 year ago

This makes it easier to implement alternative transports, such as netconf, which may already unpack <rpc-reply> on transport level before handing the contained response to the RPC client.

With https://github.com/nemith/netconf, we never see the <rpc-reply> element in the first place, only its contents are passed on.

This moves the unpacking logic to a central point and separates this change from the netconf implementation, which should result in smaller diffs to review.

Can you please tell me if you consider this a reasonable change? If you do, I'll go ahead and convert the remaining places as well.

czerwonk commented 1 year ago

I quite like the idea. Also makes the existing code more readable due to less chaining. Please go ahead if you like. Happy to review and merge when done.

Sparc0 commented 1 year ago

Would really like to have netconf support added into the exporter.