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