This article describes the issue of the usage of a script, which leads to commit errors when unsupported commands are typed and committed.
Using a commit script to throw an error, when unsupported commands are used. For example:
root@switch# set firewall family inet filter x term x from prefix-list x root@switch2# commit configuration check succeeds commit complete
root@switch# set firewall family inet filter x term x from prefix-list x
root@switch2# commit configuration check succeeds commit complete
root@switch2# show firewall family inet { filter x { term x { from { ## ## Warning: configuration block ignored: unsupported platform (ex3200-48t) ## prefix-list { x; ## 'x' is not defined } } } } }
root@switch2:RE:0% cd /var/db/scripts/commit/ root@switch2:RE:0% ls unsupported.slax
root@switch2:RE:0% cat unsupported.slax version 1.0; ns junos = "http://xml.juniper.net/junos/*/junos"; ns xnm = "http://xml.juniper.net/xnm/1.1/xnm"; ns jcs = "http://xml.juniper.net/junos/commit-scripts/1.0"; import "../import/junos.xsl"; match configuration { var $rpc = <get-configuration database="candidate" unsupported="unsupported"> ; var $config = jcs:invoke($rpc); if ($config//@unsupported) { <xnm:error> { <message> "Please Remove Unsupported or Hidden Configuration"; } } }
[edit] # set system scripts commit file unsupported.slax
[edit] root@switch2# commit error: Please Remove Unsupported or Hidden Configuration error: 1 error reported by commit scripts error: commit script failure