From db2b0256080d70d5bc2efb91baad733d21c18bec Mon Sep 17 00:00:00 2001 From: Devdeep Singh Date: Fri, 10 Jan 2014 23:33:18 +0530 Subject: [PATCH] CLOUDSTACK-5639: If path field in the TO already has the complete path, do not try to generate the path. --- .../HypervResource/CloudStackTypes.cs | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs index a3258ce5712..89f0814214e 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs @@ -168,16 +168,23 @@ namespace HypervResource } else if (this.nfsDataStore != null) { - fileName = this.nfsDataStore.UncPath; - if (this.path != null) + if (this.path != null && File.Exists(this.path)) { - fileName += @"\" + this.path; + fileName = this.path; } - - fileName = Utils.NormalizePath(fileName); - if (Directory.Exists(fileName)) + else { - fileName = Utils.NormalizePath(fileName + @"\" + this.name); + fileName = this.nfsDataStore.UncPath; + if (this.path != null) + { + fileName += @"\" + this.path; + } + + fileName = Utils.NormalizePath(fileName); + if (Directory.Exists(fileName)) + { + fileName = Utils.NormalizePath(fileName + @"\" + this.name); + } } } else