Commit 74b6f864 authored by Antoine Millet's avatar Antoine Millet
Browse files

Implemented job_wait

parent 10f56a81
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -106,5 +106,14 @@ class HostClient(Client):
        """
        return self.conn.call('plugin_uninstall', plugin)

    def job_wait(self, job_id):
        """ Wait until a job is done and return its output.
        """
        while True:
            job = self._server.db.get_by_id('.'.join((self.login, job_id)))
            if job is not None:
                if job['state'] == 'done':
                    return job


Client.register_client_class(HostClient)