]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
DaemonState: Add check_status()
authorZack Cerza <zack@redhat.com>
Fri, 10 Mar 2017 23:32:00 +0000 (16:32 -0700)
committerZack Cerza <zack@redhat.com>
Thu, 30 Mar 2017 17:12:31 +0000 (11:12 -0600)
So far, this just wraps self.proc.poll(). It's intended to provide a way
for tasks to know if their daemons are even running.

Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/orchestra/daemon.py

index acbdf70e358427e283173a6ee370bebe57f35407..df2cf3f6ccf1e73445319f6c669164154a7614a7 100644 (file)
@@ -135,6 +135,16 @@ class DaemonState(object):
             finally:
                 self.proc = None
 
+    def check_status(self):
+        """
+        Check to see if the process has exited.
+
+        :returns: The exit status, if any
+        :raises:  CommandFailedError, if the process was run with
+                  check_status=True
+        """
+        return self.proc.poll()
+
 
 class DaemonGroup(object):
     """