How to use the sysrepo.SR_OP_CREATED function in sysrepo

To help you get started, we’ve selected a few sysrepo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sysrepo / sysrepo / bindings / python / examples / python_application_changes_example.py View on Github external
def print_change(op, old_val, new_val):
    if (op == sr.SR_OP_CREATED):
           print ("CREATED: ",end='')
           print (new_val.to_string(),end='')
    elif (op == sr.SR_OP_DELETED):
           print ("DELETED: ",end='')
           print (old_val.to_string(),end='')
    elif (op == sr.SR_OP_MODIFIED):
           print ("MODIFIED: ",end='')
           print ("old value",end='')
           print (old_val.to_string(),end='')
           print ("new value",end='')
           print (new_val.to_string(),end='')
    elif (op == sr.SR_OP_MOVED):
        print ("MOVED: " + new_val.xpath() + " after " + old_val.xpath())