Enhance NFS mount option check for empty response (#11839)

This commit is contained in:
dahn 2025-12-09 10:51:42 +01:00 committed by GitHub
parent 12f4321952
commit 223fc2512c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -110,7 +110,7 @@ class TestNFSMountOptsKVM(cloudstackTestCase):
def getNFSMountOptionForPool(self, option, poolId):
nfsstat_cmd = "nfsstat -m | sed -n '/%s/{ n; p }'" % poolId
nfsstat = self.sshClient.execute(nfsstat_cmd)
if (nfsstat == None):
if nfsstat == None or len(nfsstat) == 0:
return None
stat = nfsstat[0]
vers = stat[stat.find(option):].split("=")[1].split(",")[0]