You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently everytime we need to add some files to an Importer session, we are relaying on the upload_task client library method, which is something like this:
defupload_task(self, files, use_url=False, initial_opts=None):
"""create a task with the provided files files - collection of files to upload or zip file use_url - if true, post a URL to the uploader """# @todo getting the task response updates the session tasks, but# neglects to retreive the overall session status fieldfname=os.path.basename(files[0])
_, ext=os.path.splitext(fname)
defaddopts(base):
ifinitial_opts:
# pass options in as value:key parameters, this allows multiple# options per keybase=base+'&'+'&'.join(['option=%s:%s'% (v, k) fork, vininitial_opts.items()])
returnbaseifuse_url:
ifext=='.zip':
upload_url=files[0]
else:
upload_url=os.path.dirname(files[0])
url=self._url("imports/%s/tasks?expand=3"%self.id)
upload_url="file://%s"%os.path.abspath(upload_url)
resp=self._client().post_upload_url(url, upload_url)
elifext=='.zip':
url=self._url("imports/%s/tasks/%s?expand=3"% (self.id, fname))
resp=self._client().put_zip(addopts(url), files[0])
else:
url=self._url("imports/%s/tasks?expand=3"%self.id)
resp=self._client().post_multipart(addopts(url), files)
...
From that code snippet we can clearly see that:
The method always looks for files present on the local storage, and currently this is mandatory because the GeoServer Importer is not able to read streams from different sources.
GeoNode never uses the option use_url=True, meaning that it always assumes the GeoServer Importer must be able to access the files on a shared file-system
The proposal is to change this by:
Zip the spatial files to send to the Importer on a local path, possibly managed by the StorageManager
Stream the zip file to the Importer so that we don't need a shared file-system between GeoNode and GeoServer anymore
Make sure the local zipped files are cleared once finished
The text was updated successfully, but these errors were encountered:
Currently everytime we need to add some files to an
Importer
session, we are relaying on theupload_task
client library method, which is something like this:From that code snippet we can clearly see that:
use_url=True
, meaning that it always assumes the GeoServer Importer must be able to access the files on a shared file-systemThe proposal is to change this by:
StorageManager
Importer
so that we don't need a shared file-system between GeoNode and GeoServer anymoreThe text was updated successfully, but these errors were encountered: