[conf] Clean of DOMAINS global variable
This commit is contained in:
parent
4df34b5d87
commit
64e60343bf
|
@ -10,7 +10,7 @@ import click
|
||||||
|
|
||||||
|
|
||||||
from .cli import cli
|
from .cli import cli
|
||||||
from ..conf import config, write_config, DOMAINS, DOMAINSDICT
|
from ..conf import config, write_config, DOMAINSDICT
|
||||||
|
|
||||||
from ..lib.schemas import schema_dict_dom
|
from ..lib.schemas import schema_dict_dom
|
||||||
|
|
||||||
|
@ -84,11 +84,11 @@ def domain(domains, delete, update, create, read): #, domains, read, create, up
|
||||||
# TODO: Connect to the create_domain function
|
# TODO: Connect to the create_domain function
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
domains = DOMAINS
|
domains = DOMAINSDICT().keys()
|
||||||
else:
|
else:
|
||||||
domains_ = []
|
domains_ = []
|
||||||
for domain_name in domains.split(','):
|
for domain_name in domains.split(','):
|
||||||
if domain_name in DOMAINS:
|
if domain_name in DOMAINSDICT().keys():
|
||||||
domains_.append(domain_name)
|
domains_.append(domain_name)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@ It uses the following environment variables :
|
||||||
It defines the following globals :
|
It defines the following globals :
|
||||||
|
|
||||||
- PROJECT_NAME (str)
|
- PROJECT_NAME (str)
|
||||||
- DOMAINS ([]) - seems to be unused except in this file
|
|
||||||
- DOMAINSDICT ({domain_name: domain_module})
|
- DOMAINSDICT ({domain_name: domain_module})
|
||||||
- PRODUCTION (bool)
|
- PRODUCTION (bool)
|
||||||
- BASE_DIR (str)
|
- BASE_DIR (str)
|
||||||
|
@ -46,7 +45,6 @@ from .lib.domain import d_domains
|
||||||
logger = logging.getLogger('halfapi')
|
logger = logging.getLogger('halfapi')
|
||||||
|
|
||||||
PROJECT_NAME = os.path.basename(os.getcwd())
|
PROJECT_NAME = os.path.basename(os.getcwd())
|
||||||
DOMAINS = []
|
|
||||||
DOMAINSDICT = lambda: {}
|
DOMAINSDICT = lambda: {}
|
||||||
PRODUCTION = False
|
PRODUCTION = False
|
||||||
HOST = '127.0.0.1'
|
HOST = '127.0.0.1'
|
||||||
|
|
Loading…
Reference in New Issue