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

Report provider name even in skinny mode (--full=false) (#2163)

This commit is contained in:
Tom Limoncelli
2023-03-14 13:45:32 -04:00
committed by GitHub
parent ed0094237c
commit 2be3edc0a7
2 changed files with 6 additions and 6 deletions

View File

@@ -190,7 +190,7 @@ DomainLoop:
/// This is where we should audit?
corrections, err := provider.Driver.GetDomainCorrections(dc)
out.EndProvider(len(corrections), err)
out.EndProvider(provider.Name, len(corrections), err)
if err != nil {
anyErrors = true
continue DomainLoop
@@ -212,7 +212,7 @@ DomainLoop:
log.Fatal(err)
}
corrections, err := domain.RegistrarInstance.Driver.GetRegistrarCorrections(dc)
out.EndProvider(len(corrections), err)
out.EndProvider(domain.RegistrarName, len(corrections), err)
if err != nil {
anyErrors = true
continue

View File

@@ -15,7 +15,7 @@ type CLI interface {
Printer
StartDomain(domain string)
StartDNSProvider(name string, skip bool)
EndProvider(numCorrections int, err error)
EndProvider(name string, numCorrections int, err error)
StartRegistrar(name string, skip bool)
PrintCorrection(n int, c *models.Correction)
@@ -139,10 +139,10 @@ func (c ConsolePrinter) StartRegistrar(provider string, skip bool) {
}
// EndProvider is called at the end of each provider.
func (c ConsolePrinter) EndProvider(numCorrections int, err error) {
func (c ConsolePrinter) EndProvider(name string, numCorrections int, err error) {
if err != nil {
fmt.Fprintln(c.Writer, "ERROR")
fmt.Fprintf(c.Writer, "Error getting corrections: %s\n", err)
fmt.Fprintf(c.Writer, "Error getting corrections (%s): %s\n", name, err)
} else {
plural := "s"
if numCorrections == 1 {
@@ -151,7 +151,7 @@ func (c ConsolePrinter) EndProvider(numCorrections int, err error) {
if (SkinnyReport) && (numCorrections == 0) {
return
}
fmt.Fprintf(c.Writer, "%d correction%s\n", numCorrections, plural)
fmt.Fprintf(c.Writer, "%d correction%s (%s)\n", numCorrections, plural, name)
}
}