Exemplo n.º 1
0
 def get_initial(self):
     return {
         'language': utils.get_language(self.request),
         'timezone': utils.get_timezone(self.request),
         'pagesize': settings_utils.get_page_size(self.request),
         'instance_log_length': settings_utils.get_log_length(self.request),
     }
Exemplo n.º 2
0
 def get_context_data(self, request):
     instance = self.tab_group.kwargs['instance']
     log_length = settings_utils.get_log_length(request)
     try:
         data = api.nova.server_console_output(request,
                                               instance.id,
                                               tail_length=log_length)
     except Exception:
         data = _('Unable to get log for instance "%s".') % instance.id
         exceptions.handle(request, ignore=True)
     return {"instance": instance,
             "console_log": data,
             "log_length": log_length}