]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
console: force existing connections into spy mode if !readonly 1025/head
authorIlya Dryomov <idryomov@gmail.com>
Tue, 7 Feb 2017 09:55:45 +0000 (10:55 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 7 Feb 2017 16:54:23 +0000 (17:54 +0100)
If someone watching the console didn't think of using "console -s", we
end up power cycling the node in an attempt to get the login prompt.
This is futile -- if the watcher is still there after the node comes
back up, our connection will get dropped to spy mode again.

Use -f to temporarily force existing connections into spy mode when we
attach to save a power cycle.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
teuthology/orchestra/console.py
teuthology/orchestra/test/test_console.py

index 83bbf36b6063da33e1b88d545fe9df10bf55850a..c5c4c0c0027339ca1b1e60bbc4d44fb9341c08b9 100644 (file)
@@ -82,10 +82,10 @@ class PhysicalConsole():
 
     def _console_command(self, readonly=True):
         if self.has_conserver:
-            return 'console -M {master} -p {port} {ro}{host}'.format(
+            return 'console -M {master} -p {port} {mode} {host}'.format(
                 master=self.conserver_master,
                 port=self.conserver_port,
-                ro='-s ' if readonly else '',
+                mode='-s' if readonly else '-f',
                 host=self.shortname,
             )
         else:
index c038ab354a345bd35afc2abb397152327f730d61..1e37abd73c3272fc0969f73dae21aee61836addc 100644 (file)
@@ -12,7 +12,7 @@ class TestConsole(object):
 class TestPhysicalConsole(TestConsole):
     klass = console.PhysicalConsole
     ipmi_cmd_templ = 'ipmitool -H {h}.{d} -I lanplus -U {u} -P {p} {c}'
-    conserver_cmd_templ = 'console -M {m} -p {p} {ro}{h}'
+    conserver_cmd_templ = 'console -M {m} -p {p} {mode} {h}'
 
     def setup(self):
         self.hostname = 'host'
@@ -42,14 +42,14 @@ class TestPhysicalConsole(TestConsole):
         assert console_cmd == self.conserver_cmd_templ.format(
             m=teuth_config.conserver_master,
             p=teuth_config.conserver_port,
-            ro='-s ',
+            mode='-s',
             h=self.hostname,
         )
         console_cmd = cons._console_command(readonly=False)
         assert console_cmd == self.conserver_cmd_templ.format(
             m=teuth_config.conserver_master,
             p=teuth_config.conserver_port,
-            ro='',
+            mode='-f',
             h=self.hostname,
         )