From 0e281fcc91ce8121a0dbdbbbfc47fcf710c83091 Mon Sep 17 00:00:00 2001 From: pengtao Date: Mon, 14 Oct 2019 11:43:17 +0800 Subject: [PATCH] =?UTF-8?q?db=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6move?= =?UTF-8?q?=E5=88=B0config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/config.py | 5 +++++ data_channel/gamelog_external.py | 7 +------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/config.py b/config/config.py index 795b09f..60557c2 100644 --- a/config/config.py +++ b/config/config.py @@ -3,8 +3,13 @@ import os ad_env = os.getenv('ad_env') or 'prod' log_path = "/data/logs" +args = dict() if ad_env == 'prod': interface_port = 6500 + args['host'] = '10.10.3.5' + args['user'] = 'ops' + args['pswd'] = 'deploy2018' + args['db'] = 'ywplatform' elif ad_env == 'test': interface_port = 6600 else: diff --git a/data_channel/gamelog_external.py b/data_channel/gamelog_external.py index f10d342..34b0320 100644 --- a/data_channel/gamelog_external.py +++ b/data_channel/gamelog_external.py @@ -4,7 +4,7 @@ import logging from ops.mansible import AnsibleAPI from ops.mmysql import MysqlBase import time - +from config.config import args log = logging.getLogger(__name__) @@ -68,11 +68,6 @@ class Build_Gamelog_Config(): def get_ip_addr(self): ip_addr = list() sql = f"SELECT run_server FROM `deploy_projectmanage` WHERE project_name='{self.project}' AND env='prod'" - args = dict() - args['host'] = '10.10.3.5' - args['user'] = 'deploy' - args['pswd'] = 'deploy2016' - args['db'] = 'ywplatform' mdb = MysqlBase(**args) data = mdb.query(sql) if data: