Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8F81E200AE4 for ; Thu, 26 May 2016 05:05:57 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8E69E160A2E; Thu, 26 May 2016 03:05:57 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D71B7160A29 for ; Thu, 26 May 2016 05:05:56 +0200 (CEST) Received: (qmail 69469 invoked by uid 500); 26 May 2016 03:05:48 -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 65927 invoked by uid 99); 26 May 2016 03:05:41 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 May 2016 03:05:41 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E5B0BDFF12; Thu, 26 May 2016 03:05:40 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: swill@apache.org To: commits@cloudstack.apache.org Date: Thu, 26 May 2016 03:06:17 -0000 Message-Id: <319dd4d937524cba96f70c3c5283b744@git.apache.org> In-Reply-To: <499c689eb98a479db368b0a82be15974@git.apache.org> References: <499c689eb98a479db368b0a82be15974@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [38/39] git commit: updated refs/heads/master to 3c800b4 archived-at: Thu, 26 May 2016 03:05:57 -0000 Merge pull request #1424 from syed/create-template-api-bug [CLOUDSTACK-8973] Fix create template from snapshot returning null in case of region storeThis PR fixes a case where when we create a template from a snpashot in a region wide store, we don't set the cross zone flag which causes a null response to be returned Tests: Before fix ``` (local) > create template snapshotid=33aa3f3b-5a47-4d2a-8d27-12952c01ebed displaytext=t2 ostypeid=20c8ead6-d750-11e5-9f8c-06524200007c name=t9 accountid = 1b13d7c2-d750-11e5-9f8c-06524200007c cmd = org.apache.cloudstack.api.command.admin.template.CreateTemplateCmdByAdmin created = 2016-02-23T16:09:24+0000 jobid = 4f9f5ff9-e7f0-4af6-999c-799431fd47de jobinstanceid = a08a9711-bd31-43bb-80a2-49cf9d722a19 jobinstancetype = Template jobprocstatus = 0 jobresult: null: crossZones = False isfeatured = False ispublic = False isready = False tags: jobresultcode = 0 jobresulttype = object jobstatus = 1 userid = 1b140f08-d750-11e5-9f8c-06524200007c ``` See the *null* in response After fix: ``` (local) > create template snapshotid=33aa3f3b-5a47-4d2a-8d27-12952c01ebed displaytext=t2 ostypeid=20c8ead6-d750-11e5-9f8c-06524200007c name=t11 accountid = 1b13d7c2-d750-11e5-9f8c-06524200007c cmd = org.apache.cloudstack.api.command.admin.template.CreateTemplateCmdByAdmin created = 2016-02-25T21:47:03+0000 jobid = 1b74209b-b3c1-4168-a243-f559aa0c081b jobinstanceid = 06ecee5a-b1f2-4e67-80fb-f0f44b0aa198 jobinstancetype = Template jobprocstatus = 0 jobresult: template: id = 06ecee5a-b1f2-4e67-80fb-f0f44b0aa198 name = t11 account = admin created = 2016-02-25T21:47:03+0000 crossZones = True displaytext = t2 domain = ROOT domainid = 1b13ab80-d750-11e5-9f8c-06524200007c format = VHD hypervisor = XenServer isdynamicallyscalable = False isextractable = True isfeatured = False ispublic = False isready = True ostypeid = 20c8ead6-d750-11e5-9f8c-06524200007c ostypename = CentOS 5 (64-bit) passwordenabled = False size = 21474836480 sourcetemplateid = 1af0f0cc-d750-11e5-9f8c-06524200007c sshkeyenabled = False status = Download Complete tags: templatetype = USER jobresultcode = 0 jobresulttype = object jobstatus = 1 userid = 1b140f08-d750-11e5-9f8c-06524200007c ``` Works correctly * pr/1424: Fix create template from snapshot returning null in case of region store Signed-off-by: Will Stevens Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/978184bc Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/978184bc Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/978184bc Branch: refs/heads/master Commit: 978184bccbb48ae87d0d40e174847a34c53b94e9 Parents: 6a6e164 7b5d564 Author: Will Stevens Authored: Wed May 25 23:04:30 2016 -0400 Committer: Will Stevens Committed: Wed May 25 23:04:31 2016 -0400 ---------------------------------------------------------------------- server/src/com/cloud/api/ApiResponseHelper.java | 2 +- .../com/cloud/template/TemplateManagerImpl.java | 14 +++- .../cloud/template/TemplateManagerImplTest.java | 85 ++++++++++++++++++++ 3 files changed, 99 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/978184bc/server/src/com/cloud/api/ApiResponseHelper.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/978184bc/server/src/com/cloud/template/TemplateManagerImpl.java ---------------------------------------------------------------------- diff --cc server/src/com/cloud/template/TemplateManagerImpl.java index ceee616,17c103d..c03db35 --- a/server/src/com/cloud/template/TemplateManagerImpl.java +++ b/server/src/com/cloud/template/TemplateManagerImpl.java @@@ -38,8 -38,10 +38,10 @@@ import com.google.gson.Gson import com.google.gson.GsonBuilder; import org.apache.cloudstack.api.command.user.template.GetUploadParamsForTemplateCmd; -import org.apache.cloudstack.api.response.GetUploadParamsResponse; +import org.apache.cloudstack.framework.async.AsyncCallFuture; import org.apache.cloudstack.storage.command.TemplateOrVolumePostUploadCommand; + import org.apache.cloudstack.storage.datastore.db.ImageStoreDao; + import org.apache.cloudstack.storage.datastore.db.ImageStoreVO; import org.apache.cloudstack.utils.imagestore.ImageStoreUtil; import org.apache.commons.collections.CollectionUtils; import org.apache.log4j.Logger;