-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.py
More file actions
47 lines (33 loc) · 1.06 KB
/
settings.py
File metadata and controls
47 lines (33 loc) · 1.06 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# -*- coding: utf-8 -*-
# pylint: disable=locally-disabled, multiple-statements
# pylint: disable=fixme, line-too-long, invalid-name
# pylint: disable=W0703
""" ClouDNS updater script for container format. Settings file. """
__author__ = 'safebytelabs-jgonf'
__date__ = "27/12/2019"
from os import environ, path
from environs import Env
ENV_FILE = path.join(path.abspath(path.dirname(__file__)), '.env')
try:
ENVIR = Env()
ENVIR.read_env()
except Exception as e:
print('Warning: .env file not found: %s' % e)
class Config:
"""
This is the generic loader that sets common attributes
:param: None
:return: None
"""
if environ.get('URL_CDNS'):
url_cdns = ENVIR('URL_CDNS')
if environ.get('URL_IPIO'):
url_ipio = ENVIR('URL_IPIO')
if environ.get('LOG_FILE'):
log_file = ENVIR('LOG_FILE')
if environ.get('LOG_FILE'):
log_file = ENVIR('LOG_FILE')
if environ.get('HOSTNAME'):
hostname = ENVIR('HOSTNAME')
if environ.get('SLEEPTIME'):
sleeptime = int(ENVIR('SLEEPTIME'))