bcarpio / mongodb-enc

Mongodb ENC For Puppet
5 stars 5 forks source link

How to handle attemps to add duplicate hosts #3

Closed bcarpio closed 12 years ago

bcarpio commented 12 years ago

Need to determine how to deal with existing nodes. Do they simply error out when add_node.py is called which requires them to be deleted first? Or do they get over written?

bcarpio commented 12 years ago

To solve this issue I added ensure_index('node', unique=True) to make sure mongodb wouldn't add duplicate node entries. Also put a check into add_node.py so that the script would exit out if the node already existed in the database telling the user to delete the node and then attempt to readd it.