]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
_exit_session(): also work with conserver-client
authorZack Cerza <zack@redhat.com>
Wed, 24 Aug 2016 14:53:47 +0000 (08:53 -0600)
committerZack Cerza <zack@redhat.com>
Wed, 31 Aug 2016 21:18:57 +0000 (15:18 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/orchestra/console.py

index f3a82a2110e69bb151830005ebaf01decf5b291d..65dca8cdde64229e44949a905c74d1241a6eb9fd 100644 (file)
@@ -100,12 +100,22 @@ class PhysicalConsole():
             )
 
     def _exit_session(self, child, timeout=None):
-        child.send('~.')
         t = timeout or self.timeout
-        r = child.expect(
-            ['terminated ipmitool', pexpect.TIMEOUT, pexpect.EOF], timeout=t)
-        if r != 0:
-            self._pexpect_spawn_ipmi('sol deactivate')
+        if self.has_conserver:
+            child.sendcontrol('e')
+            child.send('c.')
+            r = child.expect(
+                ['[disconnect]', pexpect.TIMEOUT, pexpect.EOF],
+                timeout=t)
+            if r != 0:
+                child.kill(15)
+        else:
+            child.send('~.')
+            r = child.expect(
+                ['terminated ipmitool', pexpect.TIMEOUT, pexpect.EOF],
+                timeout=t)
+            if r != 0:
+                self._pexpect_spawn_ipmi('sol deactivate')
 
     def _wait_for_login(self, timeout=None, attempts=2):
         """