Junos OS on-box scripts commonly use the <get-configuration> RPC to retrieve the current device configuration. However, the returned configuration might not be the actual configuration running on the device if commit scripts are deployed and they made transient configuration changes.
This divergence is possible because, rather than being reflected in the committed configuration, transient configuration changes only affect the configuration that is provided to daemons. This means that when the <get-configuration> RPC pulls the committed configuration, it will not see the transient changes introduced by commit scripts because they never actually appear in that configuration.
As of Junos OS Release 12.1, two new values have been added for the commit-scripts attribute of the <get-configuration> RPC to solve the configuration divergence:
Of the two attributes, the "apply" option is useful in this scenario. It processes any configured commit scripts before returning the configuration, allowing the modified configuration to be viewed by scripts, including both transient and permanent changes.
For more information and examples, see Including Transient Changes in Configuration Results