Skip to content

Commit

Permalink
Corrected domain detection bug
Browse files Browse the repository at this point in the history
  • Loading branch information
aacebedo committed Jun 25, 2016
1 parent 44cdf68 commit 0866756
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/updater/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ import (
"reflect"
"sync"
"time"
"github.com/op/go-logging"
)

var logger = logging.MustGetLogger("cfdnsupdater.updater")

type DomainUpdater struct {
domain string
recordTypes core.RecordTypeSlice
Expand Down Expand Up @@ -133,9 +136,10 @@ SLEEP_PERIOD:
zoneDetail.Name, recordDetail.Type, recordDetail.Name)
recordIp := net.ParseIP(recordDetail.Content)
recordType, convertErr := core.FromString(recordDetail.Type)

if !reflect.DeepEqual(recordIp, publicIP) && convertErr == nil &&
(len(self.recordTypes) == 0 || (self.recordTypes.Contains(recordType))) &&
(len(self.recordNames) == 0 || !utils.StringInSlice(recordDetail.Name,
(len(self.recordTypes) == 0 || self.recordTypes.Contains(recordType)) &&
(len(self.recordNames) == 0 || utils.StringInSlice(recordDetail.Name,
self.recordNames)) {
logger.Debugf("%s: Record %s:'%s' needs to be updated",
self.domain, recordDetail.Type, recordDetail.Name)
Expand Down

0 comments on commit 0866756

Please sign in to comment.