forked from ianbrown78/google-dns-updater
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
27 lines (20 loc) · 934 Bytes
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import logging
import os
import os.path
from dotenv import load_dotenv
from pathlib import Path
class config():
if os.path.isfile('.env'):
env_path = Path('.') / '.env'
load_dotenv(dotenv_path=env_path)
def __init__(self):
logging.info("Starting configuration.")
self.ttl = os.environ.get('ttl', 3600)
self.app = os.environ.get('app', '"app" variable has not been set.')
self.functionName = os.environ.get('FUNCTION_NAME', '')
self.gcpRegion = os.environ.get('FUNCTION_REGION', '')
self.gcpProject = os.environ.get('project', '"project" variable has not been set.')
self.gcpAuthKeyJsonFile = os.environ.get('authKeyJsonFile', '')
self.gcpDnsZoneName = os.environ.get('dnsZoneName', '"dnsZoneName" variable has not been set.')
self.gcpDnsDomain = os.environ.get('dnsDomain', '"dnsDomain" variable has not been set.')
cfg = config()