Python script couldnt detect mismatch when $instance deleted in only one
of the value nvp_add in double if else input statement
This is continuation question from stackoverflow question below: How do I
filter nested cases to be filter out python How to compare the attributes
start with $ in 2 functions and display match or mismatch
When i delete one of the $apsChanConfigNumber from nvp_add in first block
of if, the compare python script from link above couldn't detect the
mismatch, there are 2 nvp_add function under this case. How to resolve the
issue help!!!
Input file ascii plain text contain text below:
if(exists($snmpTrapEnterprise))
{
if(match($OPTION_EnableDetails, "1") or
match($OPTION_EnableDetails_juniper, "1")) {
details($snmpTrapEnterprise,$apsChanStatusSwitchovers,$apsChanStatusCurrent,$apsChanConfigGroupName,$apsChanConfigNumber)
}
@ExtendedAttr = nvp_add(@ExtendedAttr, "snmpTrapEnterprise",
$snmpTrapEnterprise, "apsChanStatusSwitchovers",
$apsChanStatusSwitchovers, "apsChanStatusCurrent",
$apsChanStatusCurrent,
"apsChanConfigGroupName", , "apsChanConfigNumber",)
}
else
{
if(match($OPTION_EnableDetails, "1") or
match($OPTION_EnableDetails_juniper, "1")) {
details($apsChanStatusSwitchovers,$apsChanStatusCurrent,$apsChanConfigGroupName,$apsChanConfigNumber)
} @ExtendedAttr = nvp_add(@ExtendedAttr, "apsChanStatusSwitchovers",
$apsChanStatusSwitchovers, "apsChanStatusCurrent", $apsChanStatusCurrent,
"apsChanConfigGroupName", $apsChanConfigGroupName, "apsChanConfigNumber",
$apsChanConfigNumber) }
No comments:
Post a Comment