Commit bc33ecc3 authored by Anael Beutot's avatar Anael Beutot
Browse files

New API + wait when cancel

parent a64dbd20
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -393,7 +393,7 @@ class Handler(HostHandler):
        """Block until completion of the given job id."""
        job = self.main.job_manager.get(job_id)
        logger.debug('Waiting for import job to terminate')
        job.join()
        job.wait()
        logger.debug('Import job terminated')

        return dict(id=job.id, log='', checksum=job.checksum)
@@ -401,7 +401,11 @@ class Handler(HostHandler):
    def vol_import_cancel(self, job_id):
        """Cancel import job."""
        logger.debug('Cancel import job')
        job = self.main.job_manager.get(job_id)
        self.main.job_manager.cancel(job_id)
        # wait for job to end
        job.join()  # we don't call wait as it is already called in
                    # vol_import_wait handler

    def vol_export(self, pool, name, raddr, rport):
        """