From a1b24a2e82c839dd316a961a1d063475ecc86b3f Mon Sep 17 00:00:00 2001 From: Tom Limoncelli Date: Sat, 21 Jan 2023 17:22:26 -0500 Subject: [PATCH] GANDI_V5: Temporarily disable ListDomains (#1962) --- commands/previewPush.go | 3 ++ providers/gandiv5/gandi_v5Provider.go | 40 +++++++++++++++------------ 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/commands/previewPush.go b/commands/previewPush.go index 1471f99e1..dc51c4a2a 100644 --- a/commands/previewPush.go +++ b/commands/previewPush.go @@ -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 } diff --git a/providers/gandiv5/gandi_v5Provider.go b/providers/gandiv5/gandi_v5Provider.go index ad8226c78..c29afa444 100644 --- a/providers/gandiv5/gandi_v5Provider.go +++ b/providers/gandiv5/gandi_v5Provider.go @@ -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