From 7ec8a7ab276f6c03a513807ca2e385e29a4e26d4 Mon Sep 17 00:00:00 2001 From: Alexander Reelsen Date: Thu, 30 Jul 2015 15:30:55 +0200 Subject: [PATCH] CLI tool: Fix exit status changes In elastic/elasticsearch#12165 the return value of the CLITool was changed from an integer to the ExitStatus enum. This commit adapts the cli tools of x-plugins. Original commit: elastic/x-pack-elasticsearch@fc6478bfa57306c77e553b471d079c399ee82094 --- .../elasticsearch/shield/authc/esusers/tool/ESUsersTool.java | 4 ++-- .../org/elasticsearch/shield/crypto/tool/SystemKeyTool.java | 4 ++-- .../watcher/trigger/schedule/tool/CronEvalTool.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/shield/src/main/java/org/elasticsearch/shield/authc/esusers/tool/ESUsersTool.java b/shield/src/main/java/org/elasticsearch/shield/authc/esusers/tool/ESUsersTool.java index b3c72214f91..41286309bb8 100644 --- a/shield/src/main/java/org/elasticsearch/shield/authc/esusers/tool/ESUsersTool.java +++ b/shield/src/main/java/org/elasticsearch/shield/authc/esusers/tool/ESUsersTool.java @@ -42,8 +42,8 @@ public class ESUsersTool extends CliTool { .build(); public static void main(String[] args) { - int status = new ESUsersTool().execute(args); - System.exit(status); + ExitStatus exitStatus = new ESUsersTool().execute(args); + System.exit(exitStatus.status()); } public ESUsersTool() { diff --git a/shield/src/main/java/org/elasticsearch/shield/crypto/tool/SystemKeyTool.java b/shield/src/main/java/org/elasticsearch/shield/crypto/tool/SystemKeyTool.java index cd174ee2449..2d8da2f82d2 100644 --- a/shield/src/main/java/org/elasticsearch/shield/crypto/tool/SystemKeyTool.java +++ b/shield/src/main/java/org/elasticsearch/shield/crypto/tool/SystemKeyTool.java @@ -36,8 +36,8 @@ public class SystemKeyTool extends CliTool { public static void main(String[] args) throws Exception { - int status = new SystemKeyTool().execute(args); - System.exit(status); + ExitStatus exitStatus = new SystemKeyTool().execute(args); + System.exit(exitStatus.status()); } private static final CliToolConfig CONFIG = config("syskey", SystemKeyTool.class) diff --git a/watcher/src/main/java/org/elasticsearch/watcher/trigger/schedule/tool/CronEvalTool.java b/watcher/src/main/java/org/elasticsearch/watcher/trigger/schedule/tool/CronEvalTool.java index 736f94dbdfb..05d73c3cc59 100644 --- a/watcher/src/main/java/org/elasticsearch/watcher/trigger/schedule/tool/CronEvalTool.java +++ b/watcher/src/main/java/org/elasticsearch/watcher/trigger/schedule/tool/CronEvalTool.java @@ -31,8 +31,8 @@ public class CronEvalTool extends CliTool { .build(); public static void main(String[] args) throws Exception { - int status = new CronEvalTool().execute(args); - System.exit(status); + ExitStatus exitStatus = new CronEvalTool().execute(args); + System.exit(exitStatus.status()); } public CronEvalTool() {