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 0D52D100DB for ; Fri, 27 Dec 2013 10:52:10 +0000 (UTC) Received: (qmail 64225 invoked by uid 500); 27 Dec 2013 10:52:08 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 64008 invoked by uid 500); 27 Dec 2013 10:52:07 -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 63994 invoked by uid 99); 27 Dec 2013 10:52:06 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Dec 2013 10:52:06 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 7A5F681A9D4; Fri, 27 Dec 2013 10:52:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sanjaytripathi@apache.org To: commits@cloudstack.apache.org Date: Fri, 27 Dec 2013 10:52:06 -0000 Message-Id: <113b1dd3de8245fcb1fe2127f5889b2b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] git commit: updated refs/heads/4.3 to 1ee3612 Updated Branches: refs/heads/4.3 029f4e36a -> 1ee3612ad CLOUDSTACK-4402: [deleteStoragePool] There is no way to delete Primary storage if the last host with which it was associated is already removed. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1ee3612a Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1ee3612a Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1ee3612a Branch: refs/heads/4.3 Commit: 1ee3612adad8e10a6dd089fda1f07256b813c211 Parents: 526043b Author: Sanjay Tripathi Authored: Thu Dec 19 17:34:26 2013 +0530 Committer: Sanjay Tripathi Committed: Fri Dec 27 16:15:00 2013 +0530 ---------------------------------------------------------------------- .../lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1ee3612a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java ---------------------------------------------------------------------- diff --git a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java index b304a00..3933915 100644 --- a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java +++ b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java @@ -473,8 +473,6 @@ public class CloudStackPrimaryDataStoreLifeCycleImpl implements PrimaryDataStore HypervisorType hType = null; if(hostPoolRecords.size() > 0 ){ hType = getHypervisorType(hostPoolRecords.get(0).getHostId()); - } else { - return false; } // Remove the SR associated with the Xenserver @@ -495,7 +493,7 @@ public class CloudStackPrimaryDataStoreLifeCycleImpl implements PrimaryDataStore } } - if (!deleteFlag) { + if (!hostPoolRecords.isEmpty() && !deleteFlag) { throw new CloudRuntimeException("Failed to delete storage pool on host"); }