Skip to content

Commit

Permalink
BF: Raise ValueError for adding of duplicate named action
Browse files Browse the repository at this point in the history
  • Loading branch information
kwirk committed Apr 28, 2013
1 parent 6d2ff47 commit 219860e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fail2ban/server/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ def __init__(self, jail):
# @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)

Expand Down

0 comments on commit 219860e

Please sign in to comment.