1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

MAINT: Unify provider outputs to pkg/printer (#1546)

* Unify provider outputs to pkg/printer

Signed-off-by: Jan-Philipp Benecke <jan-philipp@bnck.me>

* No need for custom Errorf

Signed-off-by: Jan-Philipp Benecke <jan-philipp@bnck.me>

* Add missing import for activedir

Signed-off-by: Jan-Philipp Benecke <jan-philipp@bnck.me>

* Add missing fmt import for activedir

Signed-off-by: Jan-Philipp Benecke <jan-philipp@bnck.me>
This commit is contained in:
Jan-Philipp Benecke
2022-06-18 15:01:02 +02:00
committed by GitHub
parent ba2c7f9c0e
commit bcb968411a
39 changed files with 167 additions and 136 deletions

View File

@@ -5,6 +5,7 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"log"
"sort"
"strings"
@@ -63,7 +64,7 @@ func newRoute53(m map[string]string, metadata json.RawMessage) (*route53Provider
var dls *string
if val, ok := m["DelegationSet"]; ok {
fmt.Printf("ROUTE53 DelegationSet %s configured\n", val)
printer.Printf("ROUTE53 DelegationSet %s configured\n", val)
dls = aws.String(val)
}
api := &route53Provider{client: r53.NewFromConfig(config), registrar: r53d.NewFromConfig(config), delegationSet: dls}
@@ -111,7 +112,7 @@ func withRetry(f func() error) {
if currentRetry >= maxRetries {
return
}
fmt.Printf("============ Route53 rate limit exceeded. Waiting %s to retry.\n", sleepTime)
printer.Printf("============ Route53 rate limit exceeded. Waiting %s to retry.\n", sleepTime)
time.Sleep(sleepTime)
} else {
return
@@ -673,9 +674,9 @@ func (r *route53Provider) EnsureDomainExists(domain string) error {
return nil
}
if r.delegationSet != nil {
fmt.Printf("Adding zone for %s to route 53 account with delegationSet %s\n", domain, *r.delegationSet)
printer.Printf("Adding zone for %s to route 53 account with delegationSet %s\n", domain, *r.delegationSet)
} else {
fmt.Printf("Adding zone for %s to route 53 account\n", domain)
printer.Printf("Adding zone for %s to route 53 account\n", domain)
}
in := &r53.CreateHostedZoneInput{
Name: &domain,