Merge pull request #10730 from rainzm/automated-cherry-pick-of-#10729-upstream-release-3.7

Automated cherry pick of #10729: fix(esxi): correctly set the imagePath outside the if block
This commit is contained in:
Zexi Li
2021-04-15 12:41:09 +08:00
committed by GitHub
+2 -1
View File
@@ -814,7 +814,8 @@ func (self *SHost) addDisks(ctx context.Context, dc *SDatacenter, ds *SDatastore
size = 30 * 1024
}
} else {
imagePath, err := self.FileUrlPathToDsPath(imagePath)
var err error
imagePath, err = self.FileUrlPathToDsPath(imagePath)
if err != nil {
return nil, errors.Wrapf(err, "SHost.FileUrlPathToDsPath")
}