Everyone,
I have been looking into gsconfig.py lately and started to figure it out but I
am running into an odd problem when uploading a shapefile using gsconfig.py
through the REST interface. I can figure out what the problem is but I was
wondering if anyone else has run into it before I started editing the
catalog.py.
My system: Windows 7
Geoserver: version 2.1-SNAPSHOT on localhost (OpenGeo 2.5 community version)
Here are the steps I am taking:
>>> ds = cat.get_store("POST")
>>> ds
<geoserver.store.DataStore object at 0x04686770>
>>> ds.connection_parameters.update(
host = "localhost",
port = "54321",
database = "geoserver",
user = "xxxxx",
password = "xxxxx",
dbtype="postgis")
>>> cat.save(ds)
({'date': 'Thu, 19 Jul 2012 19:40:57 GMT', 'status': '200', 'content-length':
'0', 'server': 'Noelios-Restlet-Engine/1.0..8'}, '')
>>> components = dict((ext, "D:\\temp\\upload\\old_windobs." + ext) for ext in
>>> ["shp", "prj", "shx", "dbf"])
>>> components
{'shp': 'D:\\temp\\upload\\old_windobs.shp', 'shx':
'D:\\temp\\upload\\old_windobs.shx', 'dbf':
'D:\\temp\\upload\\old_windobs.dbf', 'prj': 'D:\\temp\\upload\\old_windobs.prj'}
>>> cat.add_data_to_store(ds, "old_windobs", components)
Traceback (most recent call last):
File "<pyshell#17>", line 1, in <module>
cat.add_data_to_store(ds, "old_windobs", components)
File "build\bdist.win32\egg\geoserver\catalog.py", line 251, in
add_data_to_store
unlink(bundle)
WindowsError: [Error 32] The process cannot access the file because it is being
used by another process: 'c:\\users\\xxxxxx\\appdata\\local\\temp\\tmppk7u44'
It creates a zip file (sort of - doesn't seem to complete) but it looks like
python doesn't release a lock on it. Has anyone else run into this before? I
can confirm that the zip file contains the shapefile components.
Thanks for any information,
Jerry
ps. if I can figure this out I'll get students of mine to try to document
gsconfig next semester. I can do almost everything else I have tried with
gsconfig.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users