diff --git a/apps/backend/constants.py b/apps/backend/constants.py index c327e6c67..5a3305cac 100644 --- a/apps/backend/constants.py +++ b/apps/backend/constants.py @@ -160,19 +160,3 @@ def needs_batch_request(self) -> bool: return False return True - - -class CMDBInstanceChoices(enum.EnhanceEnum): - HOST = "cmdb_instance.host" - SCOPE = "cmdb_instance.scope" - PROCESS = "cmdb_instance.process" - SERVICE = "cmdb_instance.service" - - @classmethod - def _get_member__alias_map(cls) -> Dict[Enum, str]: - return { - cls.HOST: _("cmdb_instance.host参数"), - cls.SCOPE: _("cmdb_instance.scope参数"), - cls.PROCESS: _("cmdb_instance.process参数"), - cls.SERVICE: _("cmdb_instance.service参数"), - } diff --git a/apps/backend/subscription/tools.py b/apps/backend/subscription/tools.py index 075667b41..69a8bffa3 100644 --- a/apps/backend/subscription/tools.py +++ b/apps/backend/subscription/tools.py @@ -28,7 +28,7 @@ from django.utils import timezone from apps.backend.components.collections import core -from apps.backend.constants import CMDBInstanceChoices, FilterFieldName, InstNodeType +from apps.backend.constants import FilterFieldName, InstNodeType from apps.backend.subscription import task_tools from apps.backend.subscription.commons import get_host_by_inst, list_biz_hosts from apps.backend.subscription.constants import SUBSCRIPTION_SCOPE_CACHE_TIME @@ -833,7 +833,8 @@ def get_instances_by_scope_with_checker( scope["with_info"] = {"process": False} for step in steps: - if CMDBInstanceChoices.PROCESS.value in json.dumps(step.params): + params_str: str = json.dumps(step.params) + if "cmdb_instance.process" in params_str or "target.process" in params_str: scope["with_info"]["process"] = True break