CI: better silent and resync optional arguments

Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
This commit is contained in:
Raphael Defosseux
2021-04-28 09:39:27 +02:00
parent 42a217228b
commit 1041a6d807
2 changed files with 14 additions and 13 deletions
+3 -3
View File
@@ -111,13 +111,13 @@ class SSHConnection():
self.sshresponse = self.ssh.expect(expected)
return self.sshresponse
def command(self, commandline, expectedline, timeout):
if commandline.count('oc logs') == 0:
def command(self, commandline, expectedline, timeout, silent=False, resync=False):
if not silent:
logging.debug(commandline)
self.ssh.timeout = timeout
# Nasty patch when pexpect output is out of sync.
# Much pronounced when running back-to-back-back oc commands
if (commandline.count('oc logs') > 0) or (commandline.count('oc get') > 0):
if resync:
self.ssh.send(commandline)
self.ssh.expect([commandline, pexpect.TIMEOUT])
self.ssh.send('\r\n')