~larryprice/libertine/snap-for-1.6

« back to all changes in this revision

Viewing changes to python/libertine/LxdContainer.py

  • Committer: Tarmac
  • Author(s): Larry Price
  • Date: 2017-01-12 20:02:42 UTC
  • mfrom: (302.35.5 lxd-wait-stop)
  • Revision ID: tarmac-20170112200242-247r03mvb2ei1zft
Manually wait for lxd container to stop when specified after calling the service. Fixes: https://bugs.launchpad.net/bugs/1655980.

Approved by Christopher Townsend, Libertine CI Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
310
310
            utils.get_logger().error("No such container '%s'" % self._id)
311
311
            return False
312
312
 
313
 
        self.stop_container(wait=True)
 
313
        if not self.stop_container(wait=True):
 
314
            utils.get_logger().error("Canceling destruction due to running container")
 
315
            return False
 
316
 
314
317
        self._container.delete()
315
318
        return True
316
319
 
355
358
            return False
356
359
 
357
360
        if self._manager:
358
 
            result = LifecycleResult.from_dict(self._manager.operation_stop(self._id))
 
361
            result = LifecycleResult.from_dict(self._manager.operation_stop(self._id, {'wait': wait}))
359
362
        else:
360
363
            result = lxd_stop(self._container, wait)
361
364