Esempio n. 1
0
 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)
Esempio n. 2
0
 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)
Esempio n. 3
0
 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
Esempio n. 4
0
 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
Esempio n. 5
0
    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}
Esempio n. 6
0
    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}
Esempio n. 7
0
    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()}
Esempio n. 8
0
    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()
        }
Esempio n. 9
0
 def get_data(self, request, namespace_name):
     return glance.metadefs_namespace_get(request,
                                          namespace_name,
                                          wrap=True)
Esempio n. 10
0
 def get_data(self, request, namespace_name):
     return glance.metadefs_namespace_get(request,
                                          namespace_name,
                                          wrap=True)