- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Variable use in Block Check definition
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2023 09:57 AM
It it possible to do use a variable when defining a block check?
If I define a variable "blk-start", can I use in the follown block check?
<ConfigBlockCheck block-start=blk-start boundary-method="indent">
============================================================
<PolicyRuleLogic xmlns="http://www.infoblox.com/NetworkAutomation/1.0/ScriptXml" editor="raw-xml">
<Assign variable="test">
<Expr value="pass"/>
</Assign>
<ForEach>
<Expr method="interfaces"/>
<Do>
<If>
<ListSearch list-name="fw_interfaces" result-columns="fwName" search-columns="swName,swIntf">
<Expr field="DeviceName"/>
<Expr field="ifName" object="_loop_value"/>
</ListSearch>
<Then>
<Assign variable="blk-start">
<Expr op="concat">
<Expr value="^interface "/>
<Expr field="ifDescrRaw" object="_loop_value"/>
</Expr>
</Assign>
<If>
<ConfigBlockCheck block-start="^interface" boundary-method="indent">
<Expr op="matches">
<Expr variable="_block"/>
<Expr variable="blk-start"/>
</Expr>
</ConfigBlockCheck>
<Then>
<Assign variable="test">
<Expr value="fail"/>
</Assign>
</Then>
</If>
</Then>
</If>
</Do>
</ForEach>
<If>
<Expr op="!=">
<Expr variable="test"/>
<Expr value="pass"/>
</Expr>
<Then>
<PolicyRuleFail>
</PolicyRuleFail>
</Then>
<Else>
<PolicyRulePass>