CI: use getConnection() to simplify code
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
#-----------------$
|
#-----------------$
|
||||||
|
|||||||
Reference in New Issue
Block a user