vendorHost.py
997 Bytes
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2021/7/16 下午5:05
# @Author : 付孟奇
from util.HandleJenkins import config
from util.log import logger
'''
根据项目参数获取对应域名
1、环境
2、项目名称
'''
class VendorHost:
def __init__(self):
self.env = config['env']
self.vendor = config['pro']
# 获取项目域名
def get_api_url(self):
logger.info(str(self.vendor) + '的' + str(self.env) + '环境域名为:' + str(self.vendorHostList[self.vendor][self.env]))
return self.vendorHostList[self.vendor][self.env]
# 项目域名
vendorHostList = {
'中美大都会': {'staging': '1234', 'beta': '1234', 'vdr': 'https://vdr-staging.situdata.com/'},
'瑞泰': {'staging': 'https://staging-oldmutual-life-video.situdata.com/'},
'德华安顾': {'staging': '1234', 'beta': '1234', 'vdr': 'https://vdr-ergolife-staging.situdata.com/'}
}
vendor_host = VendorHost().get_api_url()