Blogs

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

By Erdem posted 08-06-2015 18:01

  

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.


#How-To
#ScriptingHow-To
#Slax
#commitscript