(self)
Creates, starts and provisions the container.
Creates, starts and provisions the container.
Creates starts and provisions the container .
def up(self):
        """ Creates, starts and provisions the container. """
        if self.is_running:
            logger.info('Container "{name}" is already running'.format(name=self.name))
            return

        logger.info('Starting container "{name}"...'.format(name=self.name))
        self._container.start(wait=True)
        if not self.is_running:
            logger.error('Something went wrong trying to start the container.')
            raise ContainerOperationFailed()

        ip = self._setup_ip()
        if not ip:
            return

        logger.info('Container "{name}" is up! IP: {ip}'.format(name=self.name, ip=ip))

        # Setup hostnames if applicable.
        self._setup_hostnames(ip)

        # Setup users if applicable.
        self._setup_users()

        # Setup shares if applicable.
        self._setup_shares()

        # Override environment variables
        self._setup_env()
def up ( self ) : if self . is_running : logger . info ( 'Container "{name}" is already running' . format ( name = self . name ) ) return logger . info ( 'Starting container "{name}"...' . format ( name = self . name ) ) self . _container . start ( wait = True ) if not self . is_running : logger . error ( 'Something went wrong trying to start the container.' ) raise ContainerOperationFailed ( ) ip = self . _setup_ip ( ) if not ip : return logger . info ( 'Container "{name}" is up! IP: {ip}' . format ( name = self . name , ip = ip ) ) # Setup hostnames if applicable. self . _setup_hostnames ( ip ) # Setup users if applicable. self . _setup_users ( ) # Setup shares if applicable. self . _setup_shares ( ) # Override environment variables self . _setup_env ( )