Chralu / gandyn

Gandi domain updater script for dynamic IP addresses.
72 stars 32 forks source link

Create a new record in the zone file if filtered search didn't match any results #5

Open ghost opened 11 years ago

ghost commented 11 years ago

I had some issues when using Gandyn as an updater for my Dynamic DNS server in Gandi because I didn't previously set a record for the hostname in my zone file. When I tried to run Gandyn I got an IndexError exception due to an attempt of access of an empty list of records.

This patch handles the user case when the record was not previously created. if the filtered search did'nt match any results, we create a new record in the zone file, using the information provided by the user on the configuration file.