Skip to content

Commit

Permalink
Update gsconfig and gsimporter versions
Browse files Browse the repository at this point in the history
  • Loading branch information
afabiani committed Jul 19, 2018
1 parent 1009131 commit 97d7dd0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
11 changes: 8 additions & 3 deletions geonode/geoserver/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from itertools import cycle, izip
import json
import logging
import traceback
import os
from os.path import basename, splitext, isfile
import re
Expand Down Expand Up @@ -240,24 +241,28 @@ def get_sld_for(gs_catalog, layer):
# GeoServer sometimes fails to associate a style with the data, so
# for now we default to using a point style.(it works for lines and
# polygons, hope this doesn't happen for rasters though)
gs_layer = None
_default_style = None
try:
_default_style = layer.default_style
except BaseException:
traceback.print_exc()
pass

if _default_style is None:
gs_catalog._cache.clear()
try:
gs_layer = gs_catalog.get_layer(layer.name)
name = gs_layer.default_style.name if gs_layer.default_style is not None else "raster"
except BaseException:
name = "raster"
traceback.print_exc()
name = None
else:
name = _default_style.name

# Detect geometry type if it is a FeatureType
if layer.resource and layer.resource.resource_type == 'featureType':
res = layer.resource
if gs_layer and gs_layer.resource and gs_layer.resource.resource_type == 'featureType':
res = gs_layer.resource
res.fetch()
ft = res.store.get_resources(res.name)
ft.fetch()
Expand Down
8 changes: 4 additions & 4 deletions geonode/tests/csw.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ def test_csw_outputschema_dc(self):
if link['scheme'] == 'OGC:WMS':
self.assertEqual(
link['url'],
'http://localhost:8080/geoserver/geonode/ows',
'http://localhost:8080/geoserver/ows',
'Expected a specific OGC:WMS URL')
elif link['scheme'] == 'OGC:WFS':
self.assertEqual(
link['url'],
'http://localhost:8080/geoserver/geonode/wfs',
'http://localhost:8080/geoserver/wfs',
'Expected a specific OGC:WFS URL')
elif check_ogc_backend(qgis_server.BACKEND_PACKAGE):
if link['scheme'] == 'OGC:WMS':
Expand Down Expand Up @@ -197,12 +197,12 @@ def test_csw_outputschema_iso(self):
if link.protocol == 'OGC:WMS':
self.assertEqual(
link.url,
'http://localhost:8080/geoserver/geonode/ows',
'http://localhost:8080/geoserver/ows',
'Expected a specific OGC:WMS URL')
elif link.protocol == 'OGC:WFS':
self.assertEqual(
link.url,
'http://localhost:8080/geoserver/geonode/wfs',
'http://localhost:8080/geoserver/wfs',
'Expected a specific OGC:WFS URL')
if check_ogc_backend(qgis_server.BACKEND_PACKAGE):
if link.protocol == 'OGC:WMS':
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ geonode-announcements==1.0.13 # python-geonode-announcements (1.0.13 in our ppa)
geonode-agon-ratings==0.3.8 # python-geonode-agon-ratings (0.3.8 in our ppa)
arcrest>=10.0 # TODO
geonode-dialogos==1.2 # python-geonode-dialogos (0.9 in our ppa)
gsconfig<2.0.0 # python-gsconfig (1.0.8 in our ppa)
gn-gsimporter>=1.0.7 # python-gn-gsimporter (1.0.2 in our ppa)
gsconfig>=1.0.10 # python-gsconfig (1.0.8 in our ppa)
gn-gsimporter>=1.0.8 # python-gn-gsimporter (1.0.2 in our ppa)
gisdata==0.5.4 # python-gisdata (0.5.4 in our ppa)

# haystack/elasticsearch, uncomment to use
Expand Down

0 comments on commit 97d7dd0

Please sign in to comment.