How to handle abort in show ? confd_data_cbs don't have abort callback

Hi All!

We are having issue handling stale object in our code. Here is the issue…

  1. show xyz is terminated in between by pressing q
  2. this is transparent to our code which results in stale object.

We want to get a callback when q is pressed when output is terminated in between. I saw some abort callback in transaction but that isn’t working… We have different callpoint and we register callbacks for the same via

confd_data_cbs dataCbs;

any help how to handle the abort in the cli ?.

2017-09-05T10:33:52.018727-05:00 ucc1 confd[8401]: audit user: admin/13 CLI aborted

we want a callback when this happens…


Yes, there is no abort for data callbacks.
Data callbacks (get_next, get_elem, … ) should be independent and stateless as much as possible, so there should not be need for abort. In reality, this is sometimes not possible. If you need to e.g. do some cleaning after abort, you may do it when you return last data (not abort case), when show command is invoked again (detect that previous data still exists) or when you detect end of the transaction.

There is abort for action callback. Another option may be to implement show command as CLI custom command which invokes original show command with maapi_cli_cmd_* variant. This would work only in CLI.