Automation
Automation

Scripting How-To: Retrieve pre-inheritance configuration information when using "configure private"

by Cordelia on ‎08-06-2015 06:01 PM - edited on ‎09-18-2017 02:58 PM by Administrator Administrator (930 Views)

A commit script at times requires access to the pre-inheritance configuration rather than the post-inheritance configuration it receives by default. This is typically a straightforward operation: the commit script simply invokes the <get-configuration> RPC. However, the problem is that <get-configuration> only returns the normal candidate database, and private configuration sessions use a dedicated private candidate database, making it impossible to retrieve the actual pre-inheritance database when using "configure private".

 

PR 517088, which was opened to resolve this, has now been fixed, so the pre-inheritance configuration can now be retrieved whether "configure private" is used or not. The fix is in Junos OS Release 11.4R5, 12.1R3, 12.2 and later.

 

The enhancement consists of changes to <junos-context> as well as the <get-configuration> RPC.

 

First, <junos-context> now includes a <database-path> element within its <commit-context> stanza, indicating the location of the session's candidate configuration.

 

See the document Correct Pre-Inheritance Configuration for full details.