ckan / ckanext-spatial

Geospatial extension for CKAN
http://docs.ckan.org/projects/ckanext-spatial
126 stars 193 forks source link

ckan 2.3 and csw harvest problem #143

Closed lcipriani closed 8 years ago

lcipriani commented 8 years ago

With csw job i have this error, is a ckan version problem ?

2016-01-22 11:22:58,230 INFO [ckanext.harvest.model] Error contacting the CSW server: init() takes exactly 1 argument (2 given) 2016-01-22 11:22:58,236 ERROR [ckanext.harvest.queue] Gather stage failed

Thanks!

tomkralidis commented 8 years ago

I'm guessing this is somehow a result of fc4c37c4c31b005853c59e2880a1a82ed9035435. I'll try to look deeper in the coming days

lcipriani commented 8 years ago

Hi thanks, tomkralidis . I have looked the csw_client.py file, but there is the line:

amercader commented 8 years ago

Yes, this was caused by changing the __init__ mehod params.

@tomkralidis the parent class OwsService requires an endpoint param so we need something like:

diff --git a/ckanext/spatial/lib/csw_client.py b/ckanext/spatial/lib/csw_client.py
index a592464..207a0d4 100644
--- a/ckanext/spatial/lib/csw_client.py
+++ b/ckanext/spatial/lib/csw_client.py
@@ -67,8 +67,8 @@ class CswService(OwsService):
     """
     from owslib.csw import CatalogueServiceWeb as _Implementation

-    def __init__(self):
-        super(CswService, self).__init__()
+    def __init__(self, endpoint=None):
+        super(CswService, self).__init__(endpoint)
         self.sortby = SortBy([SortProperty('dc:identifier')])

     def getrecords(self, qtype=None, keywords=[],
tomkralidis commented 8 years ago

Thanks @amercader. PR issued in #144 144

lcipriani commented 8 years ago

Thanks! @amercader

amercader commented 8 years ago

Merged, thanks both

etj commented 8 years ago

It seems that this fix has not been ported to the stable branch:: https://github.com/ckan/ckanext-spatial/blob/stable/ckanext/spatial/lib/csw_client.py#L70-L71