Updated Branches: refs/heads/master 8eedd4648 -> fa377af9b
STRATOS-355 - Need to show better result when no artifacts Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/fa377af9 Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/fa377af9 Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/fa377af9 Branch: refs/heads/master Commit: fa377af9ba221f4884de5a308d90f9023140094d Parents: 8eedd46 Author: Manula Thantriwatte <[email protected]> Authored: Tue Feb 11 15:23:28 2014 +0530 Committer: Manula Thantriwatte <[email protected]> Committed: Tue Feb 11 15:23:28 2014 +0530 ---------------------------------------------------------------------- .../stratos/cli/RestCommandLineService.java | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/fa377af9/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java index dfd1f0a..6b74e8f 100644 --- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java +++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestCommandLineService.java @@ -1016,6 +1016,14 @@ public class RestCommandLineService { Partition[] partitions = new Partition[partitionList.getPartition().size()]; partitions = partitionList.getPartition().toArray(partitions); + if (partitions.length == 0) { + if (logger.isDebugEnabled()) { + logger.debug("No partitions found"); + } + System.out.println("There are no available partitions"); + return; + } + System.out.println("Available Partitions:" ); CommandLineUtils.printTable(partitions, partitionMapper, "ID", "Provider"); System.out.println(); @@ -1070,6 +1078,14 @@ public class RestCommandLineService { AutoscalePolicy[] policyArry = new AutoscalePolicy[policyList.getAutoscalePolicy().size()]; policyArry = policyList.getAutoscalePolicy().toArray(policyArry); + if (policyArry.length == 0) { + if (logger.isDebugEnabled()) { + logger.debug("No autoscale policies found"); + } + System.out.println("There are no autoscale policies"); + return; + } + System.out.println("Available Autoscale Policies:"); CommandLineUtils.printTable(policyArry, partitionMapper, "ID"); @@ -1122,6 +1138,14 @@ public class RestCommandLineService { DeploymentPolicy[] policyArry = new DeploymentPolicy[policyList.getDeploymentPolicy().size()]; policyArry = policyList.getDeploymentPolicy().toArray(policyArry); + if (policyArry.length == 0) { + if (logger.isDebugEnabled()) { + logger.debug("No deployment policies found"); + } + System.out.println("There are no deployment policies"); + return; + } + System.out.println("Available Deployment Policies:"); CommandLineUtils.printTable(policyArry, partitionMapper, "ID"); System.out.println();
