I am testing this python script to be able to do a mass irule removal.
It appears there is an issue with
except Exception, e:
^
SyntaxError: invalid syntax
Here is the snip of that lines before and after
I have not done anything to the orginal script except to line up the tab’s and indent’s.
Here is where this script lives.
Line 51 on that page would be the line that give the error.
I see on various websites this syntax was an issue pre 2.6 but i am running
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]
for id_rule in rules:
if rule["rule_name"] == rule_to_remove:
try:
b.LocalLB.VirtualServer.remove_rule([virtualservers[count]], [[rule]])
print "\nRemove rule: %s, from vs: %s" % (rule, [virtualservers[count]])
except Exception, e:
print e
break
count +=1
Any help would be greatly appreciated as this is my first time using python.
Thanks,
ccna55