@Override protected void executeThis() { String currentDeployment = getCurrentDeployment(); // Disable validation here, since we don't want an illegal config to prevent us from fixing it. Canary canary = new OperationHandler<Canary>() .setFailureMesssage("Failed to get canary.") .setOperation(Daemon.getCanary(currentDeployment, false)) .get(); int originalHash = canary.hashCode(); AbstractCanaryServiceIntegration canaryServiceIntegration = CanaryUtils.getServiceIntegrationByName(canary, currentDeployment, getName(), true); canaryServiceIntegration.setEnabled(isEnable()); if (originalHash == canary.hashCode()) { AnsiUi.failure("No changes supplied."); return; } new OperationHandler<Void>() .setSuccessMessage("Successfully " + indicativePastPerfectAction() + " canary analysis " + getName() + " service integration.") .setFailureMesssage("Failed to " + getCommandName() + " canary analysis " + getName() + " service integration.") .setOperation(Daemon.setCanary(currentDeployment, !noValidate, canary)) .get(); } }
@Override protected void executeThis() { String currentDeployment = getCurrentDeployment(); // Disable validation here, since we don't want an illegal config to prevent us from fixing it. Canary canary = new OperationHandler<Canary>() .setFailureMesssage("Failed to get canary.") .setOperation(Daemon.getCanary(currentDeployment, false)) .get(); int originalHash = canary.hashCode(); AbstractCanaryServiceIntegration canaryServiceIntegration = CanaryUtils.getServiceIntegrationByName(canary, currentDeployment, getName(), true); canaryServiceIntegration.setEnabled(isEnable()); if (originalHash == canary.hashCode()) { AnsiUi.failure("No changes supplied."); return; } new OperationHandler<Void>() .setSuccessMessage("Successfully " + indicativePastPerfectAction() + " canary analysis " + getName() + " service integration.") .setFailureMesssage("Failed to " + getCommandName() + " canary analysis " + getName() + " service integration.") .setOperation(Daemon.setCanary(currentDeployment, !noValidate, canary)) .get(); } }