mirror of https://github.com/fail2ban/fail2ban
BF: Raise ValueError for adding of duplicate named action
parent
6d2ff47e71
commit
219860ed8e
|
@ -65,6 +65,9 @@ class Actions(JailThread):
|
|||
# @param name The action name
|
||||
|
||||
def addAction(self, name):
|
||||
# Check is action name already exists
|
||||
if name in [action.getName() for action in self.__actions]:
|
||||
raise ValueError("Action %s already exists" % name)
|
||||
action = Action(name)
|
||||
self.__actions.append(action)
|
||||
|
||||
|
|
Loading…
Reference in New Issue