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

GANDI_V5: Temporarily disable ListDomains (#1962)

This commit is contained in:
Tom Limoncelli
2023-01-21 17:22:26 -05:00
committed by GitHub
parent 178ec45254
commit a1b24a2e82
2 changed files with 26 additions and 17 deletions

View File

@ -148,6 +148,9 @@ DomainLoop:
return err
}
if !slices.Contains(zones, domain.Name) {
out.Warnf("DEBUG: zones: %v\n", zones)
out.Warnf("DEBUG: Name: %v\n", domain.Name)
out.Warnf("Domain '%s' does not exist in the '%s' profile and will be added automatically.\n", domain.Name, provider.Name)
continue // continue with next provider, as we can not determine corrections without an existing zone
}

View File

@ -100,25 +100,31 @@ func newHelper(m map[string]string, metadata json.RawMessage) (*gandiv5Provider,
// Section 3: Domain Service Provider (DSP) related functions
// ListZones lists the zones on this account.
func (client *gandiv5Provider) ListZones() ([]string, error) {
g := gandi.NewLiveDNSClient(config.Config{
APIKey: client.apikey,
SharingID: client.sharingid,
Debug: client.debug,
})
// // ListZones lists the zones on this account.
// This no longer works. Until we can figure out why, we're removing this
// feature for Gandi.
// func (client *gandiv5Provider) ListZones() ([]string, error) {
// g := gandi.NewLiveDNSClient(config.Config{
// APIKey: client.apikey,
// SharingID: client.sharingid,
// Debug: client.debug,
// })
listResp, err := g.ListDomains()
if err != nil {
return nil, err
}
// listResp, err := g.ListDomains()
// if err != nil {
// return nil, err
// }
zones := make([]string, len(listResp))
for i, zone := range listResp {
zones[i] = zone.FQDN
}
return zones, nil
}
// zones := make([]string, len(listResp))
// fmt.Printf("DEBUG: HERE START\n")
// for i, zone := range listResp {
// fmt.Printf("DEBUG: HERE %d: %v\n", i, zone.FQDN)
// zone := zone
// zones[i] = zone.FQDN
// }
// fmt.Printf("DEBUG: HERE END\n")
// return zones, nil
// }
// NB(tal): To future-proof your code, all new providers should
// implement GetDomainCorrections exactly as you see here