Ensure the correct configuration is used on each stage

This commit is contained in:
Adrià Mercader 2011-06-14 15:59:13 +01:00
parent 3125bb1514
commit c80e68a12f
1 changed files with 3 additions and 6 deletions

View File

@ -70,8 +70,7 @@ class CKANHarvester(HarvesterBase):
get_all_packages = True get_all_packages = True
package_ids = [] package_ids = []
if not self.config: self._set_config(harvest_job.source.config)
self._set_config(harvest_job.source.config)
# Check if this source has been harvested before # Check if this source has been harvested before
previous_job = Session.query(HarvestJob) \ previous_job = Session.query(HarvestJob) \
@ -157,8 +156,7 @@ class CKANHarvester(HarvesterBase):
def fetch_stage(self,harvest_object): def fetch_stage(self,harvest_object):
log.debug('In CKANHarvester fetch_stage') log.debug('In CKANHarvester fetch_stage')
if not self.config: self._set_config(harvest_object.job.source.config)
self._set_config(harvest_object.job.source.config)
# Get source URL # Get source URL
url = harvest_object.source.url.rstrip('/') url = harvest_object.source.url.rstrip('/')
@ -188,8 +186,7 @@ class CKANHarvester(HarvesterBase):
harvest_object, 'Import') harvest_object, 'Import')
return False return False
if not self.config: self._set_config(harvest_object.job.source.config)
self._set_config(harvest_object.job.source.config)
try: try:
package_dict = json.loads(harvest_object.content) package_dict = json.loads(harvest_object.content)