配置TEST 环境变量

This commit is contained in:
pengtao 2019-09-11 15:49:08 +08:00
parent 0ac61402db
commit c001a40955
2 changed files with 9 additions and 3 deletions

2
ops/env.py Normal file
View File

@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
myenv="test"

View File

@ -1,15 +1,19 @@
# -*- coding: utf-8 -*-
import os
from ops.env import myenv
ad_env = os.getenv('ad_env') or 'prod'
# ad_env = os.getenv('ad_env') or 'prod'
ad_mysql_pwd = os.getenv('adpwd') or 'vF4j56AfxU3P'
if ad_env == 'prod':
if myenv == 'prod':
redis_company_config = {'host': '10.10.4.8', 'port': 6379, 'db': 1, 'passwd': 'crs-9ltb97ds:i33dkxshh'}
mysql_promotion_config = {'user': 'ad', 'pswd': ad_mysql_pwd, 'host': '10.10.3.5', 'db': 'ad'}
elif ad_env == 'dev':
elif myenv == 'dev':
redis_company_config = {'host': '192.168.100.20', 'port': 6379, 'db': 2, 'passwd': ''}
mysql_promotion_config = {'user': 'miles', 'pswd': 'aspect', 'host': '192.168.100.30', 'db': 'test'}
elif myenv == 'test':
redis_company_config = {'host': '10.10.4.8', 'port': 6379, 'db': 11, 'passwd': 'crs-9ltb97ds:i33dkxshh'}
mysql_promotion_config = {'user': 'ad', 'pswd': ad_mysql_pwd, 'host': '10.10.3.5', 'db': 'test'}
else:
raise Exception("GET config with mysql/redis failed!")