-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathconfig.py
More file actions
39 lines (26 loc) · 1.56 KB
/
config.py
File metadata and controls
39 lines (26 loc) · 1.56 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
"""Module to read the configuration from the environment variables and provide the settings to the application
"""
import os
from pydantic_settings import BaseSettings
from dotenv import load_dotenv # pylint: disable=import-error
basedir = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(basedir, '.env'))
class Settings(BaseSettings):
"""Application Settings """
#If multiple versions of this Applications Hostname are running, this will help identify them
instance_hostname:str = os.environ.get('HOSTNAME') or 'demo_app'
#File Path where we can look for the list of ACS API Endpoints to work with
endpoint_list_json_path:str = os.environ.get('ENDPOINT_LIST_JSON_PATH') or 'endpoint_list.json'
api_retry_count:int = os.environ.get('API_RETRY_COUNT') or 3
api_read_retry_delay:int = os.environ.get('API_READ_RETRY_DELAY') or 10
endpoint_file_read_retry_count:int = os.environ.get('ENDPOINT_FILE_READ_RETRY_COUNT') or 3
endpoint_file_read_retry_delay:int = os.environ.get('ENDPOINT_FILE_READ_RETRY_DELAY') or 10
#Health Check Retry Count
health_check_retry_count:int = os.environ.get('HEALTH_CHECK_RETRY_COUNT') or 3
#Health Check Retry Delay in Seconds
health_check_retry_delay:int = os.environ.get('HEALTH_CHECK_RETRY_DELAY') or 10
#Poll Disabled Policy Information
poll_disabled_policy_info:bool = os.environ.get('POLL_DISABLED_POLICY_INFO') or False
#Output folder for the Policy output
output_folder:str = os.environ.get('OUTPUT_FOLDER') or 'output'
settings = Settings()