jc.parse(args); } catch (IllegalArgumentException e) { AnsiUi.error("Illegal argument: " + e.getMessage()); System.exit(1); } catch (ParameterException e) { hal.execute(); } catch (IllegalArgumentException e) { AnsiUi.error("Illegal argument: " + e.getMessage()); System.exit(1); } catch (Exception e) { AnsiUi.error(e.getMessage()); AnsiUi.remediation("That wasn't supposed to happen.\nPlease report an issue on https://github.com/spinnaker/halyard/issues"); System.exit(1);
jc.parse(args); } catch (IllegalArgumentException e) { AnsiUi.error("Illegal argument: " + e.getMessage()); System.exit(1); } catch (ParameterException e) { hal.execute(); } catch (IllegalArgumentException e) { AnsiUi.error("Illegal argument: " + e.getMessage()); System.exit(1); } catch (Exception e) { AnsiUi.error(e.getMessage()); AnsiUi.remediation("That wasn't supposed to happen.\nPlease report an issue on https://github.com/spinnaker/halyard/issues"); System.exit(1);
case FATAL: case ERROR: AnsiUi.error(message); break; case WARNING:
case FATAL: case ERROR: AnsiUi.error(message); break; case WARNING:
AnsiUi.error("Error encountered running script. See above output for more details."); System.exit(1);
AnsiUi.error("Error encountered running script. See above output for more details."); System.exit(1);
@Override protected void executeThis() { String currentDeployment = getCurrentDeployment(); DeploymentConfiguration deploymentConfiguration = new OperationHandler<DeploymentConfiguration>() .setOperation(Daemon.getDeploymentConfiguration(currentDeployment, false)) .setFailureMesssage("Failed to get your deployment configuration for edits.") .get(); int hash = deploymentConfiguration.hashCode(); deploymentConfiguration.setTimezone(isSet(timezone) ? timezone : deploymentConfiguration.getTimezone()); if (deploymentConfiguration.hashCode() == hash) { AnsiUi.error("No changes supplied."); return; } new OperationHandler<Void>() .setOperation(Daemon.setDeploymentConfiguration(currentDeployment, !noValidate, deploymentConfiguration)) .setFailureMesssage("Failed to apply edits to your deployment configuration") .setSuccessMessage("Successfully edited your deployment configuration") .get(); } }
@Override protected void executeThis() { String currentDeployment = getCurrentDeployment(); DeploymentConfiguration deploymentConfiguration = new OperationHandler<DeploymentConfiguration>() .setOperation(Daemon.getDeploymentConfiguration(currentDeployment, false)) .setFailureMesssage("Failed to get your deployment configuration for edits.") .get(); int hash = deploymentConfiguration.hashCode(); deploymentConfiguration.setTimezone(isSet(timezone) ? timezone : deploymentConfiguration.getTimezone()); if (deploymentConfiguration.hashCode() == hash) { AnsiUi.error("No changes supplied."); return; } new OperationHandler<Void>() .setOperation(Daemon.setDeploymentConfiguration(currentDeployment, !noValidate, deploymentConfiguration)) .setFailureMesssage("Failed to apply edits to your deployment configuration") .setSuccessMessage("Successfully edited your deployment configuration") .get(); } }