Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8F163107D6 for ; Mon, 6 Jan 2014 11:19:53 +0000 (UTC) Received: (qmail 700 invoked by uid 500); 6 Jan 2014 11:19:52 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 666 invoked by uid 500); 6 Jan 2014 11:19:52 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 658 invoked by uid 99); 6 Jan 2014 11:19:51 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Jan 2014 11:19:51 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 1B4BF44FA6; Mon, 6 Jan 2014 11:19:51 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: devdeep@apache.org To: commits@cloudstack.apache.org Message-Id: <6370f9824ec246ef80772840a0127676@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/master to 3116f51 Date: Mon, 6 Jan 2014 11:19:51 +0000 (UTC) Updated Branches: refs/heads/master 1069f56f8 -> 3116f51a2 CLOUDSTACK-5788, CLOUDSTACK-5789: Attaching upload volume and download volume was failing for hyper-v. Copy command answer was failing while creating the answer object. Fixing the issue. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/3116f51a Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3116f51a Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3116f51a Branch: refs/heads/master Commit: 3116f51a26e1673715e678ec327ba5089ff76c6d Parents: 1069f56 Author: Devdeep Singh Authored: Mon Jan 6 23:33:55 2014 +0530 Committer: Devdeep Singh Committed: Mon Jan 6 16:36:03 2014 +0530 ---------------------------------------------------------------------- .../ServerResource/HypervResource/CloudStackTypes.cs | 2 +- .../HypervResource/HypervResourceController.cs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3116f51a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs index 314c26b..226610b 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs @@ -187,7 +187,7 @@ namespace HypervResource throw new InvalidDataException(errMsg); } - if (!Path.HasExtension(fileName) && this.format != null) + if (fileName != null && !Path.HasExtension(fileName) && this.format != null) { fileName = fileName + "." + this.format.ToLowerInvariant(); } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3116f51a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs index 1725169..7f3befa 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs @@ -1321,14 +1321,16 @@ namespace HypervResource object newData = null; TemplateObjectTO destTemplateObjectTO = null; VolumeObjectTO destVolumeObjectTO = null; + VolumeObjectTO srcVolumeObjectTO = null; + TemplateObjectTO srcTemplateObjectTO = null; try { dynamic timeout = cmd.wait; // TODO: Useful? - TemplateObjectTO srcTemplateObjectTO = TemplateObjectTO.ParseJson(cmd.srcTO); + srcTemplateObjectTO = TemplateObjectTO.ParseJson(cmd.srcTO); destTemplateObjectTO = TemplateObjectTO.ParseJson(cmd.destTO); - VolumeObjectTO srcVolumeObjectTO = VolumeObjectTO.ParseJson(cmd.srcTO); + srcVolumeObjectTO = VolumeObjectTO.ParseJson(cmd.srcTO); destVolumeObjectTO = VolumeObjectTO.ParseJson(cmd.destTO); string destFile = null; @@ -1512,11 +1514,9 @@ namespace HypervResource // doesn't do anything if the directory is already present. Directory.CreateDirectory(Path.GetDirectoryName(destFile)); File.Copy(srcFile, destFile); - // create volumeto object deserialize and send it - VolumeObjectTO volume = new VolumeObjectTO(); - volume.path = destFile; - volume.size = ulong.Parse(destVolumeObjectTO.size.ToString()); - JObject ansObj = Utils.CreateCloudStackObject(CloudStackTypes.VolumeObjectTO, volume); + // Create volumeto object deserialize and send it + destVolumeObjectTO.path = destFile; + JObject ansObj = Utils.CreateCloudStackObject(CloudStackTypes.VolumeObjectTO, destVolumeObjectTO); newData = ansObj; result = true; }