forked from tpd94/CDRM-Project
32 lines
727 B
Python
32 lines
727 B
Python
"""Module to check for the config file."""
|
|
|
|
import os
|
|
|
|
|
|
def check_for_config_file():
|
|
"""Check for the config file."""
|
|
if os.path.exists(os.path.join(os.getcwd(), "configs", "config.yaml")):
|
|
return
|
|
default_config = """
|
|
default_wv_cdm: ''
|
|
default_pr_cdm: ''
|
|
secret_key_flask: 'secretkey'
|
|
# change the type to mariadb to use mariadb below
|
|
database_type: 'sqlite'
|
|
fqdn: ''
|
|
remote_cdm_secret: ''
|
|
|
|
# uncomment all the lines below to use mariadb and fill out the information
|
|
#mariadb:
|
|
# user: ''
|
|
# password: ''
|
|
# host: ''
|
|
# port: ''
|
|
# database: ''
|
|
"""
|
|
with open(
|
|
os.path.join(os.getcwd(), "configs", "config.yaml"), "w", encoding="utf-8"
|
|
) as f:
|
|
f.write(default_config)
|
|
return
|