diff --git a/apps/terminal/models/applet/applet.py b/apps/terminal/models/applet/applet.py index fd5934285..9e501eb50 100644 --- a/apps/terminal/models/applet/applet.py +++ b/apps/terminal/models/applet/applet.py @@ -172,8 +172,9 @@ class Applet(JMSBaseModel): return None spec_label = asset.labels.filter(label__name__in=['AppletHost', '发布机']).first() - if spec_label: - matched = [host for host in hosts if host.name == spec_label.value] + if spec_label and spec_label.label: + label_value = spec_label.label.value + matched = [host for host in hosts if host.name == label_value] if matched: return matched[0]