On Mon, Jul 29, 2013 at 6:29 PM, Michele Tartara <[email protected]> wrote:
[...]
> Yes, mounting is safe as in "if nobody did it before and we do it, then we
> know we are not impacting anything else".
>
> But if something is already mounted, you need to check whether it's what you
> need or not. Otherwise you might end up writing files in the wrong place
> (for example, not in the actually shared file system).
>

ACK.

> In order to check what is mounted there, you can have a look at the content
> of /etc/mtab (or at the output of "mount" executed with no parameters, which
> should be the same).
>

Should I do it as follows?

if not os.path.ismount(gluster_storage_dir):
  do_mount_operations.
else:
  etc_mtab = get_etc_mtab_contents()
  if fuse.glusterfs not in etc_mat:
    report_errors()


Any Comments? thanks.



-- 
Thanks
Weiwei  Jia (Harry Wei)

Reply via email to