Forum Discussion
Mar 02, 2015
Most likely the issue is that in the "doesiRuleExist()" function when it pulls down the iRules to check for if it's already defined, the returned value may be path delimited (ie. /Common/irule_name). If you are comparing that against "irule_name" that will fail. I'd add in some debug printing in the script to see if that's the case. If it is, you can do something like
...
$rule_name = $RuleDefinition->{"rule_name"};
if ( ($rule_name eq $name) || ($rule_name =~ /.*\/$rule_name/) ) {
...
That would check to see if the iRule name is the same or that it ends with "/$rule_name" meaning that it's prefixed with a partition. Now, this still may cause problems if you are trying to save to a different partition/folder. If you are working on /Common than this should be fine.
-Joe