_confd.cs_node_cd python API issue in ConfD 8.x.x

Hi all,

I’m sharing here a simple python script using the ConfD python API to get - for example - the ConfD state:

import os
import confd
import _confd
import socket
from _confd import maapi
_maapi_sock = None
_confd_ip = os.getenv('CONFD_ADDRESS', '127.0.0.1')
_confd_port = confd.PORT
_maapi_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
maapi.connect(_maapi_sock, _confd_ip, _confd_port)
maapi.load_schemas(_maapi_sock)
maapi.start_user_session(_maapi_sock, 'tst', 'system', ['tst'],_maapi_sock.getsockname()[0], confd.PROTO_TCP)
t_id = None
t_id = maapi.start_trans(_maapi_sock, confd.RUNNING, confd.READ)
status = maapi.get_elem(_maapi_sock, t_id, '/confd-state/daemon-status')
node = _confd.cs_node_cd(None, '/confd-state/daemon-status')
status.val2str(node)

This script works perfectly with ConfD 7.x.x (tested with 7.7.3 and 7.7.10) but in ConfD 8.0.10, the _confd.cs_node_cd() method is not working:

ValueError: Keypath /confd-state/daemon-status not found

I checked the release notes and I couldn’t find something relevant. I’d appreciate any input!
Cheers!

1 Like

Exactly same issue I have come across, as well.
I would appreciate a prompt support response, thanks!

Try node = _confd.cs_node_cd(None, '/confd-state/tfcm2:daemon-status')

In ConfD 8.0, a new YANG module tail-common-monitoring2.yang was introduced to replace the now deprecated tail-common-monitoring.yang.

1 Like

Hi Conny,
Many thanks for the input. The tfcm2 prefix works!
Kind regards,
Orestis