From cf1fbabca1c504351cbfd9d1ffe7e4e884ec076c Mon Sep 17 00:00:00 2001 From: Bai Date: Mon, 16 Nov 2020 18:22:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(command):=20=E4=BF=AE=E5=A4=8D=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E5=91=BD=E4=BB=A4=E6=89=A7=E8=A1=8C=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=88=B0host=E4=B8=BANone=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ops/models/command.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/ops/models/command.py b/apps/ops/models/command.py index 408c72915..12ffdddd1 100644 --- a/apps/ops/models/command.py +++ b/apps/ops/models/command.py @@ -78,7 +78,7 @@ class CommandExecution(OrgModelMixin): runner = CommandRunner(self.inventory) try: host = self.hosts.first() - if host.is_windows(): + if host and host.is_windows(): shell = 'win_shell' else: shell = 'shell'