Forum Discussion
stucky101_88485
Nimbostratus
Feb 26, 2013Cannot add 3rd irule to vip due to priority error even if priorities are different
Gurus
I posted this on the pycontrol group already but it's probably more of an icontrol so I'm posting it here again.
https://devcentral.f5.com/community/group/aft/2166035/asg/4
For t...
stucky101_88485
Nimbostratus
Feb 27, 2013In case you want to see how I create the irule in the first place...
lines = [" This iRule redirects to the standard maintenance page with the highest priority.\n",
" Generated by pycontrol. Manual edits will be undone.\n",
"priority 1\n",
"when HTTP_REQUEST {\n",
" HTTP::redirect http://webassets.scea.com/generic_maintenance/sceait_generic/maintenance.html\n",
"}"]
maintenance_irule = ''.join(lines)
maintenance_irule_name = 'api_maintenance'
irule_definition = { 'rule_name': maintenance_irule_name,
'rule_definition': maintenance_irule }
If rule already exists refresh it, otherwise create it.
existing_rules = lb.LocalLB.Rule.get_list()
for rule in existing_rules:
if maintenance_irule_name in rule:
pre_exists = True
break
else:
pre_exists = False
if pre_exists is True:
try:
lb.LocalLB.Rule.modify_rule([irule_definition])
print "\nThe iRule '%s' already existed but got refreshed.\n" % maintenance_irule_name
except Exception, e:
print e
sys.exit()
else:
try:
lb.LocalLB.Rule.create([irule_definition])
print "\nThe iRule '%s' was successfully created.\n" % maintenance_irule_name
except Exception, e:
print e
sys.exit()
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects