Github user neykov commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/207#discussion_r67380947
--- 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<String> 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 --
Could move all of these checks to the `executeSuccessfully` method, but
happy to merge as is.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---