diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_autofix.py b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_autofix.py index 9b1f605934..e4acb4f655 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_autofix.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/mongodb_autofix.py @@ -45,6 +45,7 @@ def get_public_data(self) -> Dict: "bk_app_abbr": AppCache.objects.get(bk_biz_id=bk_biz_id).db_app_abbr, "created_by": self.data["created_by"], "ticket_type": self.data["ticket_type"], + "db_version": "", "infos": {"MongoReplicaSet": [], "MongoShardedCluster": []}, } @@ -56,6 +57,7 @@ def shard_get_data(self) -> Dict: bk_cloud_id = self.autofix_info["bk_cloud_id"] cluster_id = self.autofix_info["cluster_ids"][0] cluster_info = MongoRepository().fetch_one_cluster(withDomain=False, id=cluster_id) + flow_parameter["db_version"] = cluster_info.major_version config = cluster_info.get_config() shards = cluster_info.get_shards() cluster = {} @@ -143,6 +145,7 @@ def rs_get_data(self) -> Dict: instances = [] for cluster_id in cluster_ids: cluster_info = MongoRepository().fetch_one_cluster(withDomain=True, id=cluster_id) + flow_parameter["db_version"] = cluster_info.major_version for member in cluster_info.get_shards()[0].members: if mongod["ip"] == member.ip: instances.append( diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/cluster_monogs_autofix.py b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/cluster_monogs_autofix.py index 5566d9949d..2320b6c3ec 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/cluster_monogs_autofix.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mongodb/sub_task/cluster_monogs_autofix.py @@ -58,16 +58,6 @@ def mongos_autofix(root_id: str, ticket_data: Optional[Dict], sub_sub_kwargs: Ac sub_sub_get_kwargs.mongos_info["conf_set_id"] = sub_sub_get_kwargs.get_config_set_name_replace( cluster_id=cluster_id ) - # 获取db版本 - db_version = sub_sub_get_kwargs.db_instance["db_version"] - # db大版本 - sub_sub_get_kwargs.db_main_version = str(db_version.split("-")[1].split(".")[0]) - # db发行版本 - sub_sub_get_kwargs.db_release_version = db_version - # db发行 - sub_sub_get_kwargs.db_release = db_version.split("-")[0] - # db版本 - sub_sub_get_kwargs.payload["db_version"] = db_version.split("-")[1] sub_sub_get_kwargs.cluster_type = ClusterType.MongoShardedCluster.value sub_sub_get_kwargs.payload["key_file"] = sub_sub_get_kwargs.get_conf( cluster_name=sub_sub_get_kwargs.db_instance["cluster_name"]