def umount(self):
"""
Unmount a mounted GlusterFS volume.
Provides users a way to free resources instead of just waiting for
python garbage collector to call __del__() at some point later.
"""
if self.fs:
ret = self._api.glfs_fini(self.fs)
if ret < 0:
err = ctypes.get_errno()
raise LibgfapiException("glfs_fini(%s) failed: %s" %
(self.fs, os.strerror(err)))
else:
# Succeeded. Protect against multiple umount() calls.
self._mounted = False
self.fs = None
评论列表
文章目录