# Print message on confd cli from python script in tailf:exec

**URL:** <https://dmap-community.ductus.global/t/print-message-on-confd-cli-from-python-script-in-tailf-exec/1474>\
**Category:** YANG\
**Created:** [August 16, 2017, 2:03pm UTC](https://dmap-community.ductus.global/t/print-message-on-confd-cli-from-python-script-in-tailf-exec/1474 "2017-08-16T14:03:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Minion](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Minion](https://dmap-community.ductus.global/u/Minion)\
**Post date:** [August 16, 2017, 2:03pm UTC](https://dmap-community.ductus.global/t/print-message-on-confd-cli-from-python-script-in-tailf-exec/1474/1 "2017-08-16T14:03:01Z")

</div>

Using tailf:exec we are calling a python script abc.py…

```
if 0:
    print "Command successful"
    exit(0)
else:
    print "Command failed"
     exit(1)

```

So, we want to print these messages on the ConfD cli.  
But whenever print statement is encountered… the script returns an error code to ConfD … and in turn ConfD is printing Error: Application Protocol error.

So how to get rid of this and print the necessary messages in ConfD cli.

---

<div class="post-metadata">

**Author:** ![greg](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@greg](https://dmap-community.ductus.global/u/greg)\
**Post date:** [August 17, 2017, 12:29am UTC](https://dmap-community.ductus.global/t/print-message-on-confd-cli-from-python-script-in-tailf-exec/1474/2 "2017-08-17T00:29:20Z")

</div>

What do you have in your YANG model for this action? Do you have a leaf of type string in your output? Take a look at examples.conf/intro/7-c\_actions at how the YANG model is set up and the Perl script returns data.

If you are still having a problem, if you could supply at least the whole action definition in your YANG model, then perhaps we can figure out what is wrong.
