To emulate missed parts of DSObject - optional file_path removing #1241
This commit is contained in:
parent
927c576e31
commit
dfc5513f86
@ -170,6 +170,7 @@ class RawObject(object):
|
|||||||
def get_file_path(self, fetch=True):
|
def get_file_path(self, fetch=True):
|
||||||
# we have to create symlink since its a common practice
|
# we have to create symlink since its a common practice
|
||||||
# to create hardlinks to jobject files
|
# to create hardlinks to jobject files
|
||||||
|
# and w/o this, it wouldn't work since we have file from mounted device
|
||||||
if self._file_path is None:
|
if self._file_path is None:
|
||||||
self._file_path = tempfile.mktemp(
|
self._file_path = tempfile.mktemp(
|
||||||
prefix='rawobject',
|
prefix='rawobject',
|
||||||
@ -185,7 +186,8 @@ class RawObject(object):
|
|||||||
return
|
return
|
||||||
self._destroyed = True
|
self._destroyed = True
|
||||||
if self._file_path is not None:
|
if self._file_path is not None:
|
||||||
os.remove(self._file_path)
|
if os.path.exists(self._file_path):
|
||||||
|
os.remove(self._file_path)
|
||||||
self._file_path = None
|
self._file_path = None
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user