def get_data(self): if not hasattr(self, "_instance"): try: instance_id = self.kwargs['instance_id'] instance = iapi.cloud_get(self.request, instance_id) instance.security_groups = api.network.server_security_groups( self.request, instance_id) except: redirect = reverse('horizon:project:instances:index') exceptions.handle(self.request, _('Unable to retrieve details for ' 'instance "%s".') % instance_id, redirect=redirect) self._instance = instance return self._instance
def get_data(self, request, instance_id): cloud = iapi.cloud_get(request, instance_id) return cloud