CI: use getConnection() to simplify code

This commit is contained in:
Robert Schmidt
2025-08-01 13:00:50 +02:00
parent be60dbd38c
commit 442c29cfcd
+2 -6
View File
@@ -73,12 +73,8 @@ class Module_UE:
def _command(self, cmd, silent = False): def _command(self, cmd, silent = False):
if cmd is None: if cmd is None:
raise Exception("no command provided") raise Exception("no command provided")
if self.host == "" or self.host == "localhost": with cls_cmd.getConnection(self.host) as c:
c = cls_cmd.LocalCmd() response = c.run(cmd, silent=silent)
else:
c = cls_cmd.RemoteCmd(self.host)
response = c.run(cmd, silent=silent)
c.close()
return response return response
#-----------------$ #-----------------$