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 73FB4200D41 for ; Wed, 22 Nov 2017 12:31:14 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 72893160BFD; Wed, 22 Nov 2017 11:31:14 +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 B8D5E160BDA for ; Wed, 22 Nov 2017 12:31:13 +0100 (CET) Received: (qmail 18927 invoked by uid 500); 22 Nov 2017 11:31:12 -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 18918 invoked by uid 99); 22 Nov 2017 11:31:12 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Nov 2017 11:31:12 +0000 From: GitBox To: commits@cloudstack.apache.org Subject: [GitHub] rhtyd commented on a change in pull request #2312: CLOUDSTACK-7793 Create Snaphot with quiesce option set to true fails ? Message-ID: <151135027223.5211.12215869610059657448.gitbox@gitbox.apache.org> archived-at: Wed, 22 Nov 2017 11:31:14 -0000 rhtyd commented on a change in pull request #2312: CLOUDSTACK-7793 Create Snaphot with quiesce option set to true fails ? URL: https://github.com/apache/cloudstack/pull/2312#discussion_r152537685 ########## File path: server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java ########## @@ -603,9 +603,9 @@ private boolean orchestrateDeleteVMSnapshot(Long vmSnapshotId) { _accountMgr.checkAccess(caller, null, true, vmSnapshot); - // check VM snapshot states, only allow to delete vm snapshots in created and error state - if (VMSnapshot.State.Ready != vmSnapshot.getState() && VMSnapshot.State.Expunging != vmSnapshot.getState() && VMSnapshot.State.Error != vmSnapshot.getState()) { - throw new InvalidParameterValueException("Can't delete the vm snapshotshot " + vmSnapshotId + " due to it is not in Created or Error, or Expunging State"); + // check VM snapshot states, only allow to delete vm snapshots in ready, expunging, allocated and error state + if (VMSnapshot.State.Ready != vmSnapshot.getState() && VMSnapshot.State.Expunging != vmSnapshot.getState() && VMSnapshot.State.Error != vmSnapshot.getState() && VMSnapshot.State.Allocated != vmSnapshot.getState()) { + throw new InvalidParameterValueException("Can't delete the vm snapshotshot " + vmSnapshotId + " due to it is not in Ready, Error, Allocated or Expunging State"); Review comment: @yvsubhash can you fix the typo in `snapshotshot`, perhaps consider checking if `vmSnapshot.getState()` is in in the list of states, instead of comparing against each individually. You may further use that `list` of states in the thrown exception. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services