Skip to content

Commit

Permalink
Error checks add subcommand to avoid duplicate instances (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Racine authored and sjrct committed Oct 28, 2016
1 parent 693dba0 commit 6021e52
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ def h_add(args):
continue

(name, conf) = cls.configure({ 'of': clspath })

if name in bot.config["agent-instances"] or name in bot.config["module-instances"]:
print("Instance name '{}' is already in configuration, please choose a different instance name".format(name))
return

bot.config[destkey][name] = conf

with open("config.json","w") as f:
Expand Down

0 comments on commit 6021e52

Please sign in to comment.