@SuppressWarnings("resource")
public int execWithLogging(Map<String,?> props, final String summaryForLogging, final List<String> commands, final Map<String,?> env, final ExecRunner execCommand) {
if (commandLogger!=null && commandLogger.isDebugEnabled()) {
commandLogger.debug("{}, initiating "+shortName.toLowerCase()+" on machine {}{}: {}", new Object[] {summaryForLogging, getTargetName(),
env!=null && !env.isEmpty() ? " (env "+env+")": "", Strings.join(commands, " ; ")});
commandLogger.debug("{}, on machine {}, ending: no commands to run", summaryForLogging, getTargetName());
return 0;
commandLogger.debug("{}, on machine {}, failed: {}", new Object[] {summaryForLogging, getTargetName(), e});
throw Throwables.propagate(e);
} finally {