From 2ea26273b807b1e4a955133a391512a25cc82d10 Mon Sep 17 00:00:00 2001 From: Basir Jamil Date: Thu, 6 Jun 2019 17:25:16 -0400 Subject: [PATCH] started populate fxn --- octodns/provider/fastdns.py | 57 +++++++------------------------------ 1 file changed, 10 insertions(+), 47 deletions(-) diff --git a/octodns/provider/fastdns.py b/octodns/provider/fastdns.py index 1ce91d0..56e94f8 100644 --- a/octodns/provider/fastdns.py +++ b/octodns/provider/fastdns.py @@ -7,9 +7,9 @@ from __future__ import absolute_import, division, print_function, \ ## octodns specfic imports: from os.path import expanduser -import ConfigParser - -# import os ## command line workaround +import requests +from akamai.edgegrid import EdgeGridAuth +from urlparse import urljoin import logging @@ -40,53 +40,12 @@ class AkamaiProvider(BaseProvider): super(AkamaiProvider, self).__init__(id, *args, **kwargs) self._authenticate(client_secret, host, access_token, client_token) + self._zone_records = {} def _authenticate(self, client_secret, host, access_token, client_token): - # ## generate edgegrid - # section_name = "dns" - # home = expanduser("~") - # index = 0 - # fields = {} - - # ## process original .edgerc file - # origConfig = ConfigParser.ConfigParser() - # filename = "%s/.edgerc" % home - - # # If this is a new file, create it - # if not os.path.isfile(filename): - # open(filename, 'a+').close() - - # origConfig.read(filename) - - # ## credential type already exists, prompt to overwrite - # if section_name in origConfig.sections(): - # print (">>> Replacing section: %s" % section_name) - # sys.stdout.write ("*** OK TO REPLACE section %s? *** [Y|n]:" % section_name) - # real_raw_input = vars(__builtins__).get('raw_input',input) - # choice = real_raw_input().lower() - # if choice == "n": - # print ("Not replacing section.") - # return - # replace_section = True - # else: - # print ("+++ Creating section: %s" % section_name) - # replace_section = False - - # ## open the ~/.edgerc file for writing - # Config = ConfigParser.ConfigParser() - # Config.read(filename) - # confile = open(filename, 'w') - - - # ## add the new section - - - - #### create credential file, and write credentials to it - - + ## generate edgegrid home = expanduser("~") filename = "%s/.edgerc" % home with open(filename, 'a') as credFile: @@ -100,6 +59,10 @@ class AkamaiProvider(BaseProvider): credFile.close() def populate(self, zone, target=False, lenient=False): - pass + self.log.debug('populate: name=%s, target=%s, lenient=%s', zone.name, + target, lenient) + + print ("populate(%s)", zone.name) +