コード例 #1
0
ファイル: views.py プロジェクト: amotoki/horizon
 def _get_object(self, *args, **kwargs):
     namespace_id = self.kwargs['namespace_id']
     try:
         return glance.metadefs_namespace_get(self.request, namespace_id)
     except Exception:
         redirect = self.success_url
         msg = _('Unable to retrieve namespace details.')
         exceptions.handle(self.request, msg, redirect=redirect)
コード例 #2
0
ファイル: views.py プロジェクト: tomascribb10/horizon
 def _get_object(self, *args, **kwargs):
     namespace_id = self.kwargs['namespace_id']
     try:
         return glance.metadefs_namespace_get(self.request, namespace_id)
     except Exception:
         redirect = self.success_url
         msg = _('Unable to retrieve namespace details.')
         exceptions.handle(self.request, msg, redirect=redirect)
コード例 #3
0
ファイル: views.py プロジェクト: tomascribb10/horizon
 def get_data(self):
     try:
         namespace = glance.metadefs_namespace_get(
             self.request, self.kwargs['namespace_id'], wrap=True)
     except Exception:
         url = reverse_lazy(constants.METADATA_INDEX_URL)
         exceptions.handle(self.request,
                           _('Unable to retrieve namespace details.'),
                           redirect=url)
     else:
         return namespace
コード例 #4
0
ファイル: views.py プロジェクト: CiscoSystems/avos
 def get_data(self):
     try:
         namespace = glance.metadefs_namespace_get(
             self.request, self.kwargs['namespace_id'], wrap=True)
     except Exception:
         url = reverse_lazy(constants.METADATA_INDEX_URL)
         exceptions.handle(self.request,
                           _('Unable to retrieve namespace details.'),
                           redirect=url)
     else:
         return namespace
コード例 #5
0
ファイル: tabs.py プロジェクト: lostmap/horizon-prod
    def get_context_data(self, request):
        namespace_name = self.tab_group.kwargs['namespace_id']
        try:
            namespace = glance.metadefs_namespace_get(request,
                                                      namespace_name,
                                                      wrap=True)
        except Exception:
            namespace = None
            msg = _('Unable to retrieve namespace details.')
            exceptions.handle(request, msg)

        return {"namespace": namespace}
コード例 #6
0
ファイル: tabs.py プロジェクト: 28607895/horizon
    def get_context_data(self, request):
        namespace_name = self.tab_group.kwargs['namespace_id']
        try:
            namespace = glance.metadefs_namespace_get(request,
                                                      namespace_name,
                                                      wrap=True)
        except Exception:
            namespace = None
            msg = _('Unable to retrieve namespace details.')
            exceptions.handle(request, msg)

        return {"namespace": namespace}
コード例 #7
0
ファイル: tabs.py プロジェクト: 28607895/horizon
    def get_context_data(self, request):
        namespace_id = self.tab_group.kwargs['namespace_id']
        try:
            namespace = glance.metadefs_namespace_get(request,
                                                      namespace_id,
                                                      wrap=True)
        except Exception:
            msg = _('Unable to retrieve namespace contents.')
            exceptions.handle(request, msg)
            return None

        return {
            'namespace_name': namespace.namespace,
            "namespace_contents": namespace.as_json()}
コード例 #8
0
ファイル: tabs.py プロジェクト: lostmap/horizon-prod
    def get_context_data(self, request):
        namespace_id = self.tab_group.kwargs['namespace_id']
        try:
            namespace = glance.metadefs_namespace_get(request,
                                                      namespace_id,
                                                      wrap=True)
        except Exception:
            msg = _('Unable to retrieve namespace contents.')
            exceptions.handle(request, msg)
            return None

        return {
            'namespace_name': namespace.namespace,
            "namespace_contents": namespace.as_json()
        }
コード例 #9
0
ファイル: tables.py プロジェクト: stackhpc/horizon
 def get_data(self, request, namespace_name):
     return glance.metadefs_namespace_get(request,
                                          namespace_name,
                                          wrap=True)
コード例 #10
0
ファイル: tables.py プロジェクト: 28607895/horizon
 def get_data(self, request, namespace_name):
     return glance.metadefs_namespace_get(request,
                                          namespace_name,
                                          wrap=True)