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 5804B200B0F for ; Fri, 17 Jun 2016 11:40:17 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 56910160A61; Fri, 17 Jun 2016 09:40:17 +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 C6484160A50 for ; Fri, 17 Jun 2016 11:40:16 +0200 (CEST) Received: (qmail 81125 invoked by uid 500); 17 Jun 2016 09:40:16 -0000 Mailing-List: contact dev-help@brooklyn.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.apache.org Delivered-To: mailing list dev@brooklyn.apache.org Received: (qmail 81114 invoked by uid 99); 17 Jun 2016 09:40:15 -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; Fri, 17 Jun 2016 09:40:15 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 90607E049D; Fri, 17 Jun 2016 09:40:15 +0000 (UTC) From: geomacy To: dev@brooklyn.apache.org Reply-To: dev@brooklyn.apache.org References: In-Reply-To: Subject: [GitHub] brooklyn-server pull request #207: Ensure detection of failed pre.install.co... Content-Type: text/plain Message-Id: <20160617094015.90607E049D@git1-us-west.apache.org> Date: Fri, 17 Jun 2016 09:40:15 +0000 (UTC) archived-at: Fri, 17 Jun 2016 09:40:17 -0000 Github user geomacy commented on a diff in the pull request: https://github.com/apache/brooklyn-server/pull/207#discussion_r67484653 --- Diff: software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessSshDriver.java --- @@ -285,45 +296,54 @@ public void copyInstallResources() { } } + private void executeSuccessfully(ConfigKey configKey, String label) { + log.debug("Executing {} on entity {}", label, entity.getDisplayName()); + int result = execute(ImmutableList.of(getEntity().getConfig(configKey)), label); + if (0 != result) { + log.debug("Executing {} failed with return code {}", label, result); + throw new IllegalStateException("commands for " + configKey.getName() + " failed with return code " + result); + } + } + @Override public void runPreInstallCommand() { if(Strings.isNonBlank(getEntity().getConfig(BrooklynConfigKeys.PRE_INSTALL_COMMAND))) { --- End diff -- That would be cleaner, let me do that. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---