Commit 79b483e6 authored by Raphael Defosseux's avatar Raphael Defosseux

fix(ci): no history also for single ssh commands

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent af47dc62
...@@ -157,22 +157,24 @@ class SSHConnection(): ...@@ -157,22 +157,24 @@ class SSHConnection():
if not silent: if not silent:
logging.debug(commandline) logging.debug(commandline)
self.cmd2Results = '' self.cmd2Results = ''
noHistoryCmd = 'unset HISTFILE; ' + commandline
myHost = self.username + '@' + self.ipaddress myHost = self.username + '@' + self.ipaddress
# CAUTION: THIS METHOD IMPLIES THAT THERE ARE VALID SSH KEYS # CAUTION: THIS METHOD IMPLIES THAT THERE ARE VALID SSH KEYS
# BETWEEN THE PYTHON EXECUTOR NODE AND THE REMOTE HOST # BETWEEN THE PYTHON EXECUTOR NODE AND THE REMOTE HOST
# OTHERWISE IT WON'T WORK # OTHERWISE IT WON'T WORK
lSsh = subprocess.Popen(["ssh", "%s" % myHost, commandline],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) lSsh = subprocess.Popen(["ssh", "%s" % myHost, noHistoryCmd],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
self.cmd2Results = str(lSsh.stdout.readlines()) self.cmd2Results = str(lSsh.stdout.readlines())
def command3(self, commandline, timeout, silent=False): def command3(self, commandline, timeout, silent=False):
if not silent: if not silent:
logging.debug(commandline) logging.debug(commandline)
self.cmd2Results = '' self.cmd2Results = ''
noHistoryCmd = 'unset HISTFILE; ' + commandline
myHost = self.username + '@' + self.ipaddress myHost = self.username + '@' + self.ipaddress
# CAUTION: THIS METHOD IMPLIES THAT THERE ARE VALID SSH KEYS # CAUTION: THIS METHOD IMPLIES THAT THERE ARE VALID SSH KEYS
# BETWEEN THE PYTHON EXECUTOR NODE AND THE REMOTE HOST # BETWEEN THE PYTHON EXECUTOR NODE AND THE REMOTE HOST
# OTHERWISE IT WON'T WORK # OTHERWISE IT WON'T WORK
lSsh = subprocess.Popen(["ssh", "%s" % myHost, commandline],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) lSsh = subprocess.Popen(["ssh", "%s" % myHost, noHistoryCmd],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
return lSsh.stdout.readlines() return lSsh.stdout.readlines()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment