Skip to content

Commit

Permalink
Merge pull request #267 from ccancellieri/validate_wms
Browse files Browse the repository at this point in the history
Make ckanext.spatial.harvest.validate_wms working again #265
  • Loading branch information
amercader authored Feb 21, 2022
2 parents 0f67cc9 + 90eb2aa commit bce9075
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions ckanext/spatial/harvesters/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,11 +734,7 @@ def _is_wms(self, url):
Uses owslib WMS reader to parse the response.
'''
try:
capabilities_url = wms.WMSCapabilitiesReader().capabilities_url(url)
res = urlopen(capabilities_url, None, 10)
xml = res.read()

s = wms.WebMapService(url, xml=xml)
s = wms.WebMapService(url)
return isinstance(s.contents, dict) and s.contents != {}
except Exception as e:
log.error('WMS check for %s failed with exception: %s' % (url, six.text_type(e)))
Expand Down

0 comments on commit bce9075

Please sign in to comment.