Skip to content

Commit e054154

Browse files
author
Girish Shilamkar
committed
LOUDSTACK-6861: Fixing nfs mount path
1 parent 7e355de commit e054154

1 file changed

Lines changed: 19 additions & 12 deletions

File tree

tools/marvin/marvin/lib/utils.py

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ def is_snapshot_on_nfs(apiclient, dbconn, config, zoneid, snapshotid):
315315
nfsurl = secondaryStore.url
316316
from urllib2 import urlparse
317317
parse_url = urlparse.urlsplit(nfsurl, scheme='nfs')
318-
host, path = parse_url.netloc, parse_url.path
318+
host, path = str(parse_url.netloc), str(parse_url.path)
319319

320320
if not config.mgtSvr:
321321
raise Exception("Your marvin configuration does not contain mgmt server credentials")
@@ -328,17 +328,24 @@ def is_snapshot_on_nfs(apiclient, dbconn, config, zoneid, snapshotid):
328328
user,
329329
passwd
330330
)
331+
332+
pathSeparator = "" #used to form host:dir format
333+
if not host.endswith(':'):
334+
pathSeparator= ":"
335+
331336
cmds = [
332-
"mkdir -p %s /mnt/tmp",
333-
"mount -t %s %s%s /mnt/tmp" % (
334-
'nfs',
335-
host,
336-
path,
337-
),
338-
"test -f %s && echo 'snapshot exists'" % (
339-
os.path.join("/mnt/tmp", snapshotPath)
340-
),
341-
]
337+
338+
"mkdir -p %s /mnt/tmp",
339+
"mount -t %s %s%s%s /mnt/tmp" % (
340+
'nfs',
341+
host,
342+
pathSeparator,
343+
path,
344+
),
345+
"test -f %s && echo 'snapshot exists'" % (
346+
os.path.join("/mnt/tmp", snapshotPath)
347+
),
348+
]
342349

343350
for c in cmds:
344351
result = ssh_client.execute(c)
@@ -494,4 +501,4 @@ def verifyRouterState(apiclient, routerid, allowedstates):
494501
return [FAIL, "Redundant state of the router should be in %s but is %s" %
495502
(allowedstates, routers[0].redundantstate)]
496503
return [PASS, None]
497-
504+

0 commit comments

Comments
 (0)