From f75327239d99048ce7a0124ec9c73d0ae582092b Mon Sep 17 00:00:00 2001 From: Girish Shilamkar Date: Tue, 17 Jun 2014 15:37:25 +0530 Subject: [PATCH] CLOUDSTACK-6861: Fixing nfs mount path (cherry picked from commit a5415d93eb791bac52c40b9ede6a433a0d7f1dca) --- tools/marvin/marvin/lib/utils.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/marvin/marvin/lib/utils.py b/tools/marvin/marvin/lib/utils.py index 4194e32da37..bdf5c09049e 100644 --- a/tools/marvin/marvin/lib/utils.py +++ b/tools/marvin/marvin/lib/utils.py @@ -348,7 +348,7 @@ def is_snapshot_on_nfs(apiclient, dbconn, config, zoneid, snapshotid): nfsurl = secondaryStore.url from urllib2 import urlparse parse_url = urlparse.urlsplit(nfsurl, scheme='nfs') - host, path = parse_url.netloc, parse_url.path + host, path = str(parse_url.netloc), str(parse_url.path) if not config.mgtSvr: raise Exception( @@ -364,11 +364,17 @@ def is_snapshot_on_nfs(apiclient, dbconn, config, zoneid, snapshotid): user, passwd ) + + pathSeparator = "" #used to form host:dir format + if not host.endswith(':'): + pathSeparator= ":" + cmds = [ "mkdir -p %s /mnt/tmp", - "mount -t %s %s:%s /mnt/tmp" % ( + "mount -t %s %s%s%s /mnt/tmp" % ( 'nfs', host, + pathSeparator, path, ), "test -f %s && echo 'snapshot exists'" % (