I have been tasked with updating an action (python) I didn't design. This action has no call to "transaction.apply". I have proof that it is working and actually applying the changes made, but it never appears to actually make the commit itself and I have no idea how or why, or where to look (its possible that this flag is not in the python code itself, but I can't find it).
Generally speaking the code looks like this (specifics removed):
vars = ncs.template.Variables()
m = ncs.maapi.Maapi()
root = ncs.maagic.get_root()
if uinfo.actx_thandle != -1:
# When invoked from the CLI we get a transaction
# Note: unless we are in configure mode it will be read-only
m.attach2(0, 0, uinfo.actx_thandle)
trans = maapi.Transaction(m, uinfo.actx_thandle)
else:
# Start write transaction and apply it at end
trans = m.start_write_trans(usid=uinfo.usid)
do_apply = True
template = ncs.template.Template(trans, "/")
#Do some logic with inputs
#apply the templates
vars.add('thingie', things[0])
template.apply('MyTemplate', vars)
#that's all folks, there's nothing after the template.apply
The question is this: When is this transaction actually committed/Applied?
With followup questions of: If I want to add the results of a dry run, but commit anyway, do I have to manually commit after running the dry run, otherwise this will NOT commit?