RYA-421 Updated the Rya Shell to print a different message when there are no Rya instances to list.
Project: http://git-wip-us.apache.org/repos/asf/incubator-rya/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-rya/commit/eadfcdd3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-rya/tree/eadfcdd3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-rya/diff/eadfcdd3 Branch: refs/heads/master Commit: eadfcdd36ef07d76dc4e372a6a3e208c30ff7a53 Parents: ed82a6f Author: kchilton2 <kevin.e.chil...@gmail.com> Authored: Fri Jan 5 15:05:07 2018 -0500 Committer: kchilton2 <kevin.e.chil...@gmail.com> Committed: Fri Jan 5 17:04:48 2018 -0500 ---------------------------------------------------------------------- .../main/java/org/apache/rya/shell/RyaAdminCommands.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-rya/blob/eadfcdd3/extras/shell/src/main/java/org/apache/rya/shell/RyaAdminCommands.java ---------------------------------------------------------------------- diff --git a/extras/shell/src/main/java/org/apache/rya/shell/RyaAdminCommands.java b/extras/shell/src/main/java/org/apache/rya/shell/RyaAdminCommands.java index cfe13dd..f8fee10 100644 --- a/extras/shell/src/main/java/org/apache/rya/shell/RyaAdminCommands.java +++ b/extras/shell/src/main/java/org/apache/rya/shell/RyaAdminCommands.java @@ -198,10 +198,17 @@ public class RyaAdminCommands implements CommandMarker { final Optional<String> ryaInstance = shellState.getRyaInstanceName(); try { - // Sort the names alphabetically. final List<String> instanceNames = commands.getListInstances().listInstances(); + + // Return a special message when there are no instances installed. + if(instanceNames.isEmpty()) { + return "There are no Rya instances installed on this storage."; + } + + // Sort the names alphabetically. Collections.sort( instanceNames ); + // Return a pretty print of the instances that have been installed. final String report; final InstanceNamesFormatter formatter = new InstanceNamesFormatter(); if(ryaInstance.isPresent()) {