@Override protected void executeThis() { String accountName = getAccountName(); String serviceIntegration = getServiceIntegration(); String currentDeployment = getCurrentDeployment(); // Disable validation here, since we don't want an illegal config to prevent us from fixing it. AbstractCanaryAccount account = new OperationHandler<AbstractCanaryAccount>() .setFailureMesssage("Failed to get canary account " + accountName + " for service integration " + serviceIntegration + ".") .setOperation(Daemon.getCanaryAccount(currentDeployment, serviceIntegration.toLowerCase(), accountName, false)) .get(); int originaHash = account.hashCode(); account = editAccount((T)account); if (originaHash == account.hashCode()) { AnsiUi.failure("No changes supplied."); return; } new OperationHandler<Void>() .setFailureMesssage("Failed to edit canary account " + accountName + " for service integration " + serviceIntegration + ".") .setSuccessMessage("Successfully edited canary account " + accountName + " for service integration " + serviceIntegration + ".") .setOperation(Daemon.setCanaryAccount(currentDeployment, serviceIntegration.toLowerCase(), accountName, !noValidate, account)) .get(); } }
@Override protected void executeThis() { String accountName = getAccountName(); String serviceIntegration = getServiceIntegration(); String currentDeployment = getCurrentDeployment(); // Disable validation here, since we don't want an illegal config to prevent us from fixing it. AbstractCanaryAccount account = new OperationHandler<AbstractCanaryAccount>() .setFailureMesssage("Failed to get canary account " + accountName + " for service integration " + serviceIntegration + ".") .setOperation(Daemon.getCanaryAccount(currentDeployment, serviceIntegration.toLowerCase(), accountName, false)) .get(); int originaHash = account.hashCode(); account = editAccount((T)account); if (originaHash == account.hashCode()) { AnsiUi.failure("No changes supplied."); return; } new OperationHandler<Void>() .setFailureMesssage("Failed to edit canary account " + accountName + " for service integration " + serviceIntegration + ".") .setSuccessMessage("Successfully edited canary account " + accountName + " for service integration " + serviceIntegration + ".") .setOperation(Daemon.setCanaryAccount(currentDeployment, serviceIntegration.toLowerCase(), accountName, !noValidate, account)) .get(); } }