Example #1
0
 def get_context_data(self, request):
     server_group_id = self.tab_group.kwargs['server_group_id']
     try:
         server_group = stx_nova.server_group_get(request, server_group_id)
         server_group.members_display = []
         for member in server_group.members:
             server_group.members_display.append(
                 dict(id=member, instance=nova.server_get(request, member)))
     except Exception:
         redirect = reverse('horizon:project:server_groups:index')
         exceptions.handle(self.request,
                           _('Unable to retrieve server group details.'),
                           redirect=redirect)
     return {'server_group': server_group}
Example #2
0
    def get_data(self, request, server_group_id):
        server_group = stx_nova.server_group_get(request, server_group_id)
        if not server_group.name:
            server_group.name = server_group_id

        return server_group