Skip to content

Commit

Permalink
Better config structure.
Browse files Browse the repository at this point in the history
  • Loading branch information
kiarn committed Apr 29, 2023
1 parent c7f9bba commit 836ff03
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions plugins/dns_api/manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from aj.plugins.dns_api.api import ApiDnsManager
import aj

class Domain:

Expand All @@ -25,9 +26,11 @@ class DomainManager:

def __init__(self, context):
self.context = context
# gandi is currently the only provider
provider_id = aj.config.data.get('dns_api', {}).get('provider', 'gandi')

for provider in ApiDnsManager.all(self.context):
# TODO : gandi is the only one, need to prepare a config entry
if provider.id == 'gandi':
if provider.id == provider_id:
self.api_provider = provider
break
self.domains = {}
Expand Down

0 comments on commit 836ff03

Please sign in to comment.