Factorize code between nfs.py and glusterfs.py

Suppressed most duplicated code between nfs.py and glusterfs.py.

Change-Id: I8a25aa6e3b8947a1d8e75dc611fac217e3009c41
Fixes: bug #1204213
Merge "Factorize code between nfs.py and glusterfs.py"