(self)
Stops the container.
Stops the container.
Stops the container .
def halt(self):
        """ Stops the container. """
        if not self.exists:
            logger.info("The container doesn't exist.")
            return

        if self.is_stopped:
            logger.info('The container is already stopped.')
            return

        # Removes configurations related to container's hostnames if applicable.
        self._unsetup_hostnames()

        logger.info('Stopping...')
        try:
            self._container.stop(timeout=30, force=False, wait=True)
        except LXDAPIException:
            logger.warning("Can't stop the container. Forcing...")
            self._container.stop(force=True, wait=True)
def halt ( self ) : if not self . exists : logger . info ( "The container doesn't exist." ) return if self . is_stopped : logger . info ( 'The container is already stopped.' ) return # Removes configurations related to container's hostnames if applicable. self . _unsetup_hostnames ( ) logger . info ( 'Stopping...' ) try : self . _container . stop ( timeout = 30 , force = False , wait = True ) except LXDAPIException : logger . warning ( "Can't stop the container. Forcing..." ) self . _container . stop ( force = True , wait = True )