Skip to content

Commit

Permalink
bugfix: 自定义业务拓扑场景下新建策略报错 (closed #1010)
Browse files Browse the repository at this point in the history
  • Loading branch information
CohleRustW authored and ZhuoZhuoCrayon committed Aug 26, 2022
1 parent 31b7bd6 commit b2b0c35
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions apps/iam/handlers/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def to_json(cls):
}

@classmethod
def create_simple_instance(cls, instance_id: str, attribute=None) -> Resource:
def create_simple_instance(cls, instance_id: int, attribute=None) -> Resource:
"""
创建简单资源实例
:param instance_id: 实例ID
Expand Down Expand Up @@ -84,7 +84,7 @@ class Business(ResourceMeta):
related_instance_selections = [{"system_id": system_id, "id": "business", "ignore_iam_path": True}]

@classmethod
def create_instance(cls, instance_id: str, attribute=None) -> Resource:
def create_instance(cls, instance_id: int, attribute=None) -> Resource:
resource = cls.create_simple_instance(instance_id, attribute)

bk_biz_name = str(instance_id)
Expand Down
7 changes: 1 addition & 6 deletions apps/node_man/tools/host_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from apps.backend.constants import InstNodeType
from apps.node_man import constants, models
from apps.node_man.handlers.cmdb import CmdbHandler
from apps.utils.local import get_request


class HostV2Tools:
Expand Down Expand Up @@ -66,11 +65,7 @@ def fetch_set_ids(bk_biz_id: int, target_inst_id: int, action: Optional[str] = N
:param action: iam action type
:return: 集群ID列表
"""
params = {"bk_biz_id": bk_biz_id, "is_superuser": get_request().user.is_superuser, "with_biz_node": True}
if action:
params.update({"action": action})

biz_topo = CmdbHandler().fetch_topo(**params)
biz_topo = CmdbHandler().fetch_topo(bk_biz_id=bk_biz_id, with_biz_node=True)
stack = [biz_topo]
target_node = None

Expand Down
3 changes: 3 additions & 0 deletions dev_log/2.2.22/xcwang_202208221738.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfix:
- "自定义业务拓扑场景下新建策略报错 (closed #1010)"

0 comments on commit b2b0c35

Please sign in to comment.