def get_status(self, request): """Gets general bootstrap status, and task status if not yet completed.""" self.check_xsrf_token(self.request_state) response_message = bootstrap_messages.BootstrapStatusResponse() response_message.enabled = bootstrap.is_bootstrap_enabled() response_message.started = bootstrap.is_bootstrap_started() response_message.completed = bootstrap.is_bootstrap_completed() for name, status in bootstrap.get_bootstrap_task_status().iteritems(): response_message.tasks.append( bootstrap_messages.BootstrapTask( name=name, description=status.get('description'), success=status.get('success'), timestamp=status.get('timestamp'), details=status.get('details'))) return response_message
def get_status(self, request): """Gets general bootstrap and bootstrap task status.""" self.check_xsrf_token(self.request_state) response_message = bootstrap_messages.BootstrapStatusResponse() for name, status in bootstrap.get_bootstrap_task_status().iteritems(): response_message.tasks.append( bootstrap_messages.BootstrapTask( name=name, description=status.get('description'), success=status.get('success'), timestamp=status.get('timestamp'), details=status.get('details'))) response_message.is_update = bootstrap.is_update() response_message.started = bootstrap.is_bootstrap_started() response_message.completed = bootstrap.is_bootstrap_completed() response_message.app_version = constants.APP_VERSION response_message.running_version = config_model.Config.get( 'running_version') return response_message
def __init__(self, *args, **kwargs): """Override RequestHandler init to track app readiness.""" super(FrontendHandler, self).__init__(*args, **kwargs) self.bootstrap_started = bootstrap.is_bootstrap_started() self.bootstrap_completed = bootstrap.is_bootstrap_completed()
def test_is_bootstrap_started(self): self.assertFalse(bootstrap.is_bootstrap_started()) bootstrap.config_model.Config.set('bootstrap_started', True) self.assertTrue(bootstrap.is_bootstrap_started())
def test_is_bootstrap_started_and_completed(self): config_model.Config.set('bootstrap_completed', True) config_model.Config.set('bootstrap_started', True) # bootstrap_started is false (not in progress) if bootstrap completed. self.assertFalse(bootstrap.is_bootstrap_started())