From 442c29cfcd51b9f00db1433ef262638c450b0069 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 31 Jul 2025 18:29:00 +0200 Subject: [PATCH] CI: use getConnection() to simplify code --- ci-scripts/cls_module.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ci-scripts/cls_module.py b/ci-scripts/cls_module.py index 65edbfdb56..3fed4f3dd6 100644 --- a/ci-scripts/cls_module.py +++ b/ci-scripts/cls_module.py @@ -73,12 +73,8 @@ class Module_UE: def _command(self, cmd, silent = False): if cmd is None: raise Exception("no command provided") - if self.host == "" or self.host == "localhost": - c = cls_cmd.LocalCmd() - else: - c = cls_cmd.RemoteCmd(self.host) - response = c.run(cmd, silent=silent) - c.close() + with cls_cmd.getConnection(self.host) as c: + response = c.run(cmd, silent=silent) return response #-----------------$