[GeoNode-devel] Unable to use OWSLib get_schema function when the permission's layer is not viewable from Anyone

Dimitris Karakostis karakostis.dimitris at gmail.com
Mon Sep 26 01:25:38 PDT 2016


I figured out that the error is related with OWSLib and more specifically
that get_schema function doesn't take as input any authentication
parameters.
I have opened an issue here:
https://goo.gl/Y9ffFZ

On Thu, Sep 22, 2016 at 1:51 PM, Dimitris Karakostis <
karakostis.dimitris at gmail.com> wrote:

>
>
> I use OWSLib (0.12.0) to retrieve the schema of a layer from Geoserver:
>
>    wfs = WebFeatureService(location, version='1.1.0')
>    schema = wfs.get_schema(name_of_layer)
>
> This works fine as long as the checkbox: Anyone (in the permissions modal:
> Who can view it tab)  for this layer is selected.
> If I uncheck the checkbox I get an error related to:
>
>     schema = wfs.get_schema(name_of_layer)
>
> I also tried to pass authentication parameters to the WebFeatureService as
> described here (https://goo.gl/ffpHg7) but this doesn't
> seem to fix the issue.
>
> This is the error I get:
>
> Traceback:
> File "/home/vagrant/.venvs/geonode/lib/python2.7/site-packages/django/core/handlers/base.py"
> in get_response
>   112.                     response = wrapped_callback(request,
> *callback_args, **callback_kwargs)
> File "/home/vagrant/.venvs/geonode/lib/python2.7/site-packages/
> django/contrib/auth/decorators.py" in _wrapped_view
>   22.                 return view_func(request, *args, **kwargs)
> File "/home/vagrant/geonode/geonode/layers/views.py" in layer_edit_data
>   1171.     schema = wfs.get_schema(name)
> File "/home/vagrant/.venvs/geonode/lib/python2.7/site-packages/owslib/feature/__init__.py"
> in get_schema
>   157.         return get_schema(self.url, typename, self.version)
> File "/home/vagrant/.venvs/geonode/lib/python2.7/site-packages/owslib/feature/schema.py"
> in get_schema
>   40.     res = openURL(url, timeout=timeout)
> File "/home/vagrant/.venvs/geonode/lib/python2.7/site-packages/owslib/util.py"
> in openURL
>   213.             raise ServiceException(str(
> serviceException.text).strip())
>
> Exception Type: ServiceException at /layers/geonode:afghanistan_
> asdasdas/edit_data
> Exception Value:
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-devel/attachments/20160926/5a1b94f2/attachment.html>


More information about the geonode-devel mailing list