Updated Branches:
  refs/heads/master 24086e311 -> f6e1352a4

Add validation to cartridge subscription in CLI


Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/f6e1352a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/f6e1352a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/f6e1352a

Branch: refs/heads/master
Commit: f6e1352a4584844767dcff45c596b67f2452ec3d
Parents: 24086e3
Author: Manula Thantriwatte <[email protected]>
Authored: Wed Jan 8 16:10:46 2014 +0530
Committer: Manula Thantriwatte <[email protected]>
Committed: Wed Jan 8 16:10:46 2014 +0530

----------------------------------------------------------------------
 .../org/apache/stratos/cli/RestCommandLineService.java  |  2 +-
 .../apache/stratos/cli/commands/SubscribeCommand.java   | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6e1352a/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 cfc37b9..ae25f23 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
@@ -763,7 +763,7 @@ public class RestCommandLineService {
             AutoscalePolicy[] policyArry = new 
AutoscalePolicy[policyList.getAutoscalePolicy().size()];
             policyArry = policyList.getAutoscalePolicy().toArray(policyArry);
 
-            System.out.println("Available Partitions:");
+            System.out.println("Available Autoscale Policies:");
             CommandLineUtils.printTable(policyArry, partitionMapper, "ID", 
"Display name", "Description");
             System.out.println();
 

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f6e1352a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/SubscribeCommand.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/SubscribeCommand.java
 
b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/SubscribeCommand.java
index 9e0de49..d0ed264 100644
--- 
a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/SubscribeCommand.java
+++ 
b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/commands/SubscribeCommand.java
@@ -195,6 +195,18 @@ public class SubscribeCommand implements 
Command<StratosCommandContext> {
                                        }
                                        dataCartridgeAlias = 
commandLine.getOptionValue(CliConstants.DATA_ALIAS_OPTION);
                                }
+
+                if (depPolicy == null) {
+                    System.out.println("Deployment policy is required.");
+                    context.getStratosApplication().printUsage(getName());
+                    return CliConstants.BAD_ARGS_CODE;
+                }
+
+                if (asPolicy == null) {
+                    System.out.println("Autoscaling policy is required.");
+                    context.getStratosApplication().printUsage(getName());
+                    return CliConstants.BAD_ARGS_CODE;
+                }
                                
                                if (StringUtils.isNotBlank(username) && 
StringUtils.isBlank(password)) {
                                        password = 
context.getApplication().getInput("GIT Repository Password", '*');

Reply via email to