From 7c0e02539c23609d12b79304b88e91c4acc457c7 Mon Sep 17 00:00:00 2001 From: Tom Limoncelli Date: Fri, 21 Feb 2020 12:54:00 -0500 Subject: [PATCH] ACTIVEDIRECTORY: Implement get-zones (#643) * activedir: implement get-zones --- providers/activedir/domains.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/providers/activedir/domains.go b/providers/activedir/domains.go index 235795492..77e78dda6 100644 --- a/providers/activedir/domains.go +++ b/providers/activedir/domains.go @@ -39,10 +39,12 @@ var supportedTypes = map[string]bool{ // GetZoneRecords gets the records of a zone and returns them in RecordConfig format. func (client *adProvider) GetZoneRecords(domain string) (models.Records, error) { - return nil, fmt.Errorf("not implemented") - // This enables the get-zones subcommand. - // Implement this by extracting the code from GetDomainCorrections into - // a single function. For most providers this should be relatively easy. + // Read foundRecords: + foundRecords, err := c.getExistingRecords(dc.Name) + if err != nil { + return nil, fmt.Errorf("c.getExistingRecords(%q) failed: %v", dc.Name, err) + } + return foundRecords, nil } // GetDomainCorrections gets existing records, diffs them against existing, and returns corrections.