Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiSchwarz-cnic committed Jul 31, 2018
1 parent 142a1dc commit d1f230c
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions providers/hexonet/records.go
Expand Up @@ -47,11 +47,6 @@ func (n *HXClient) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Corr
actual := make([]*models.RecordConfig, len(records))
for i, r := range records {
actual[i] = toRecord(r, dc.Name)
//b, err := json.MarshalIndent(actual[i], "", " ")
//if err != nil {
// fmt.Println("error:", err)
//}
//fmt.Print(string(b))
}

for _, rec := range dc.Records {
Expand All @@ -60,7 +55,7 @@ func (n *HXClient) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Corr
}
}

//checkNSModifications(dc) //TODO can we drop that out or is ok to reuse?
//checkNSModifications(dc)

// Normalize
models.PostProcessRecords(actual)
Expand Down Expand Up @@ -112,17 +107,6 @@ func (n *HXClient) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Corr
return corrections, nil
}

//func checkNSModifications(dc *models.DomainConfig) {
// newList := make([]*models.RecordConfig, 0, len(dc.Records))
// for _, rec := range dc.Records {
//if rec.Type == "NS" && rec.GetLabel() == "@" {
//continue //TODO Apex NS records are automatically created for the domain's nameservers and cannot be managed otherwise via the hexonet API.
//}
// newList = append(newList, rec)
// }
// dc.Records = newList
//}

func toRecord(r *HXRecord, origin string) *models.RecordConfig {
rc := &models.RecordConfig{
Type: r.Type,
Expand Down Expand Up @@ -168,7 +152,6 @@ func (n *HXClient) updateZoneBy(params map[string]string, domain string) error {
}
for key, val := range params {
cmd[key] = val
//fmt.Println(key + " -> " + val)
}
// n.showCommand(cmd)
r := n.client.Request(cmd)
Expand Down Expand Up @@ -207,7 +190,7 @@ func (n *HXClient) getRecords(domain string) ([]*HXRecord, error) {
rrs := r.GetColumn("RR")
for _, rr := range rrs {
spl := strings.Split(rr, " ")
if spl[3] != "SOA" { // skip SOA
if spl[3] != "SOA" {
record := &HXRecord{
Raw: rr,
DomainName: domain,
Expand All @@ -227,13 +210,6 @@ func (n *HXClient) getRecords(domain string) ([]*HXRecord, error) {
} else {
record.Answer = strings.Join(spl[4:len(spl)], " ")
}

//b, err := json.MarshalIndent(record, "", " ")
//if err != nil {
// fmt.Println("error:", err)
//}
//fmt.Print(string(b))

records = append(records, record)
}
}
Expand Down

0 comments on commit d1f230c

Please sign in to comment.