|
@@ -67,11 +67,12 @@ class HDFStemporaryUploadedFile(object):
|
|
|
|
|
|
|
|
# We want to set the user to be the user doing the upload
|
|
# We want to set the user to be the user doing the upload
|
|
|
self._fs.setuser(request.user.username)
|
|
self._fs.setuser(request.user.username)
|
|
|
- try:
|
|
|
|
|
- self._path = self._fs.mkswap(name, suffix='tmp', basedir=destination)
|
|
|
|
|
- self._file = self._fs.open(self._path, 'w')
|
|
|
|
|
- except WebHdfsException, e:
|
|
|
|
|
- raise e
|
|
|
|
|
|
|
+ self._path = self._fs.mkswap(name, suffix='tmp', basedir=destination)
|
|
|
|
|
+
|
|
|
|
|
+ if self._fs.exists(self._path):
|
|
|
|
|
+ self._fs._delete(self._path)
|
|
|
|
|
+ self._file = self._fs.open(self._path, 'w')
|
|
|
|
|
+
|
|
|
self._do_cleanup = True
|
|
self._do_cleanup = True
|
|
|
|
|
|
|
|
def __del__(self):
|
|
def __del__(self):
|