diff --git a/apps/ops/models/command.py b/apps/ops/models/command.py index 13e3c1714..9ce44e20f 100644 --- a/apps/ops/models/command.py +++ b/apps/ops/models/command.py @@ -63,7 +63,7 @@ class CommandExecution(models.Model): if ok: runner = CommandRunner(self.inventory) try: - host = self.hosts[0] + host = self.hosts.first() if host.is_windows(): shell = 'win_shell' else: