'Ensure that the Cinder user can write to the share.
If not, raise an exception.
:param path: path to test
:raises: RemoteFSException
:returns: None'

def _ensure_share_writable(self, path):

    prefix = (('.cinder-write-test-' + str(os.getpid())) + '-')
    try:
        tempfile.NamedTemporaryFile(prefix=prefix, dir=path)
    except OSError:
        msg = (_('Share    at    %(dir)s    is    not    writable    by    the    Cinder    volume    service.    Snapshot    operations    will    not    be    supported.') % {'dir': path})
        raise exception.RemoteFSException(msg)
