@@ -208,13 +208,14 @@ class MysqlSingleApplyFlowBuilder(BaseMySQLSingleTicketFlowBuilder):
208208 inner_flow_name = _ ("MySQL单节点部署执行" )
209209 resource_apply_builder = MysqlSingleApplyResourceParamBuilder
210210
211- def patch_dbconfig (self , cluster_type ):
211+ @classmethod
212+ def patch_dbconfig (cls , ticket , cluster_type ):
212213 # 补充数据库版本和字符集
213214 db_config = DBConfigApi .query_conf_item (
214215 {
215- "bk_biz_id" : str (self . ticket .bk_biz_id ),
216+ "bk_biz_id" : str (ticket .bk_biz_id ),
216217 "level_name" : dbconf_const .LevelName .MODULE ,
217- "level_value" : str (self . ticket .details ["db_module_id" ]),
218+ "level_value" : str (ticket .details ["db_module_id" ]),
218219 "conf_file" : dbconf_const .DEPLOY_FILE_NAME ,
219220 "conf_type" : dbconf_const .ConfType .DEPLOY ,
220221 "namespace" : cluster_type ,
@@ -226,8 +227,8 @@ def patch_dbconfig(self, cluster_type):
226227 if not db_config .get ("db_version" ) or not db_config .get ("charset" ):
227228 raise TicketParamsVerifyException (_ ("获取数据库配置失败,请检查获取参数db_config: {}" ).format (db_config ))
228229
229- self . ticket .update_details (db_version = db_config .get ("db_version" ), charset = db_config .get ("charset" ))
230+ ticket .update_details (db_version = db_config .get ("db_version" ), charset = db_config .get ("charset" ))
230231
231232 def patch_ticket_detail (self ):
232- self .patch_dbconfig (cluster_type = ClusterType .TenDBSingle )
233+ self .patch_dbconfig (ticket = self . ticket , cluster_type = ClusterType .TenDBSingle )
233234 super ().patch_ticket_detail ()
0 commit comments