Skip to content

Commit

Permalink
Merge 3974795 into dd3e818
Browse files Browse the repository at this point in the history
  • Loading branch information
chandrikas committed Apr 19, 2016
2 parents dd3e818 + 3974795 commit 015a5eb
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions drivers/NFSSR.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ def validate_remotepath(self, scan):
def check_server(self):
try:
if self.dconf.has_key(PROBEVERSION):
nfs.check_server_tcp(self.remoteserver)
sv = nfs.get_supported_nfs_versions(self.remoteserver)
if len(sv):
self.nfsversion = sv[0]
else:
nfs.check_server_tcp(self.remoteserver, self.nfsversion)
except nfs.NfsException, exc:
Expand All @@ -119,12 +121,7 @@ def check_server(self):

def mount(self, mountpoint, remotepath, timeout = 0):
try:
if self.dconf.has_key(PROBEVERSION):
nfs.soft_mount(
mountpoint, self.remoteserver, remotepath, self.transport,
timeout=timeout)
else:
nfs.soft_mount(
nfs.soft_mount(
mountpoint, self.remoteserver, remotepath, self.transport,
timeout=timeout, nfsversion=self.nfsversion)
except nfs.NfsException, exc:
Expand All @@ -142,6 +139,10 @@ def attach(self, sr_uuid):

def mount_remotepath(self, sr_uuid, timeout = 0):
if not self._checkmount():
# FIXME: What is the purpose of this check_server?
# It doesn't stop us from continuing if the server
# doesn't support the requested version. We fail
# in mount instead
self.check_server()
self.mount(self.path, self.remotepath, timeout)

Expand Down

0 comments on commit 015a5eb

Please sign in to comment.