Explorar el Código

CTS: make the systemd logic more reliable

rely on positive logic as there can be multiple
failure reasons.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Angus Salkeld hace 14 años
padre
commit
1a0ce3b4c2
Se han modificado 1 ficheros con 5 adiciones y 3 borrados
  1. 5 3
      cts/corosync.py

+ 5 - 3
cts/corosync.py

@@ -260,9 +260,11 @@ class corosync_needle(ClusterManager):
         (rc, lines) = self.rsh(node, self["StatusCmd"], stdout=2)
         (rc, lines) = self.rsh(node, self["StatusCmd"], stdout=2)
         out = str(lines)
         out = str(lines)
 
 
-        if 'systemctl' in out:
-            is_running = ('active (running)' in out)
-            ret = (rc is 0 and is_running is 0)
+        if 'systemd' in out:
+            if 'running' in out:
+                ret = 2
+            else:
+                ret = 0
         else:
         else:
             is_stopped = string.find(out, 'stopped')
             is_stopped = string.find(out, 'stopped')
             is_dead = string.find(out, 'dead')
             is_dead = string.find(out, 'dead')