Return-Path: X-Original-To: apmail-cloudstack-issues-archive@www.apache.org Delivered-To: apmail-cloudstack-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C424818C14 for ; Mon, 11 Apr 2016 03:59:25 +0000 (UTC) Received: (qmail 47251 invoked by uid 500); 11 Apr 2016 03:59:25 -0000 Delivered-To: apmail-cloudstack-issues-archive@cloudstack.apache.org Received: (qmail 47220 invoked by uid 500); 11 Apr 2016 03:59:25 -0000 Mailing-List: contact issues-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 issues@cloudstack.apache.org Received: (qmail 47204 invoked by uid 500); 11 Apr 2016 03:59:25 -0000 Delivered-To: apmail-incubator-cloudstack-issues@incubator.apache.org Received: (qmail 47199 invoked by uid 99); 11 Apr 2016 03:59:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Apr 2016 03:59:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 73E0E2C1F56 for ; Mon, 11 Apr 2016 03:59:25 +0000 (UTC) Date: Mon, 11 Apr 2016 03:59:25 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: cloudstack-issues@incubator.apache.org Message-ID: In-Reply-To: References: Subject: =?utf-8?Q?[jira]_[Commented]_(CLOUDSTACK-9323)_Cancelling_host_maint?= =?utf-8?Q?enance_results_in_""Internal_?= =?utf-8?Q?error_cancelling_maintenance.=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CLOUDSTACK-9323?page=3Dcom.atla= ssian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId= =3D15234468#comment-15234468 ]=20 ASF GitHub Bot commented on CLOUDSTACK-9323: -------------------------------------------- Github user abhinandanprateek commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1454#discussion_r59152198 =20 --- Diff: tools/marvin/marvin/lib/utils.py --- @@ -520,4 +520,22 @@ def verifyRouterState(apiclient, routerid, allowed= states): if routers[0].state.lower() not in allowedstates: return [FAIL, "state of the router should be in %s but is %s" = % (allowedstates, routers[0].state)] - return [PASS, None] \ No newline at end of file + return [PASS, None] + + + +def wait_until(retry_interval=3D2, no_of_times=3D2, callback=3DNone, *= callback_args): + """ Utility method to try out the callback method at most no_of_ti= mes with a interval of retry_interval, + Will return immediately if callback returns True. The callback met= hod should be written to return a list of values first being a boolean """ + + if callback is None: + return INVALID_INPUT --- End diff -- =20 Due to following two reason I preferred returning an error code instead= of an exception. 1. Returning a pre-defined error code makes it usage more flexible as = raising an exception or continue will be defined by the user of the method. 2. "INVALID_INPUT" is a Marvin error code used by other utility methods= to signal bad inputs and this maintains that pattern. > Cancelling host maintenance results in ""Internal error cancelling mainte= nance.=E2=80=9D > -------------------------------------------------------------------------= ------- > > Key: CLOUDSTACK-9323 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-932= 3 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the defa= ult.)=20 > Reporter: Abhinandan Prateek > Assignee: Abhinandan Prateek > Fix For: Future > > > When we try to cancel the host from maintenance, all the hosts are compla= ining ""Internal error cancelling maintenance.=E2=80=9D but successfully en= abling the host back. > In both scenarios like host is in up or disconnected state. > This causes problem when we programmatically cancel maintenance=E2=80=A6. -- This message was sent by Atlassian JIRA (v6.3.4#6332)