

def get_metadata(self, request, **kwargs):
    if (not hasattr(self, '_metadata')):
        try:
            metadata = api.heat.resource_metadata_get(request, kwargs['stack_id'], kwargs['resource_name'])
            self._metadata = json.dumps(metadata, indent=2)
        except Exception:
            msg = _('Unable to retrieve metadata.')
            redirect = reverse('horizon:project:stacks:index')
            exceptions.handle(request, msg, redirect=redirect)
    return self._metadata

dataset/ETHPy150Open Havate/havate-openstack/proto-build/gui/horizon/Horizon_GUI/openstack_dashboard/dashboards/project/stacks/views.py ResourceView.get_metadata/original