GeoNode / geonode

GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data.
https://geonode.org/
Other
1.44k stars 1.12k forks source link

cascading_delete fails in _get_default_style when style not found #214

Closed jj0hns0n closed 12 years ago

jj0hns0n commented 12 years ago

GeoServer failed to detect the projection for layer [hti_inlandwaters_watershed_polygon_092008]. It doesn't look like EPSG:4326, so backing out the layer. GeoServer failed to detect the projection for layer [hti_inlandwaters_watershed_polygon_092008]. It doesn't look like EPSG:4326, so backing out the layer. Traceback (most recent call last): File "manage.py", line 11, in execute_manager(settings) File "/home/opendri/geonode/lib/python2.6/site-packages/django/core/management/init.py", line 438, in execute_manager utility.execute() File "/home/opendri/geonode/lib/python2.6/site-packages/django/core/management/init.py", line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/opendri/geonode/lib/python2.6/site-packages/django/core/management/base.py", line 191, in run_from_argv self.execute(_args, _options.dict) File "/home/opendri/geonode/lib/python2.6/site-packages/django/core/management/base.py", line 218, in execute output = self.handle(_args, _options) File "/home/opendri/geonode/src/GeoNodePy/geonode/maps/management/commands/geonode_import.py", line 27, in handle upload(path, opts['user'], opts['overwrite'], opts['keywords'].split()) File "/home/opendri/geonode/src/GeoNodePy/geonode/maps/utils.py", line 657, in upload keywords=keywords File "/home/opendri/geonode/src/GeoNodePy/geonode/maps/utils.py", line 614, in file_upload new_layer = save(layer, filename, theuser, overwrite, keywords=keywords) File "/home/opendri/geonode/src/GeoNodePy/geonode/maps/utils.py", line 398, in save cascading_delete(cat, gs_resource) File "/home/opendri/geonode/src/GeoNodePy/geonode/maps/gs_helpers.py", line 147, in cascading_delete styles = lyr.styles + [lyr.default_style] File "/home/opendri/geonode/src/gsconfig.py/src/geoserver/layer.py", line 89, in _get_default_style name = self.dom.find("defaultStyle/name").text AttributeError: 'NoneType' object has no attribute 'text' (geonode)opendri@opendri:~/opendri$

drwelby commented 12 years ago

I'll look into this - it might be related to https://github.com/drwelby/geonode/commit/2ac9d28ceed577cfb8fbb50ff8708b40c7c40aae

drwelby commented 12 years ago

Fixed in gsconfig: https://github.com/dwins/gsconfig.py/pull/27 .

The pull request also adds recurse=true to delete() which could be used to simplify gs_helpers.cascading_delete() a little bit.

jj0hns0n commented 12 years ago

@dwins is it possible for you to review these changes in gsconfig and potentially pull them. @ingenieroariel I believe you are the one making gsconfig releases to pypi these days (could be mistaken), if so, once these are verified and pulled we will need to make a release with this before the next GeoNode Alpha Release.

jj0hns0n commented 12 years ago

Can we close this one with the latest gsconfig release?

ingenieroariel commented 12 years ago

This has been fixed in gsconfig 0.6