Updated Branches: refs/heads/master 221f3dbfe -> 0590f2ff4
Remove unnecessary print statements Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/8a03dc0b Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/8a03dc0b Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/8a03dc0b Branch: refs/heads/master Commit: 8a03dc0bd03cf8e3f3c16ad72dca0d57bb652341 Parents: 2bd2d4a Author: Manula Thantriwatte <[email protected]> Authored: Wed Dec 11 15:40:10 2013 +0530 Committer: Manula Thantriwatte <[email protected]> Committed: Wed Dec 11 15:40:10 2013 +0530 ---------------------------------------------------------------------- .../java/org/apache/stratos/cli/RestClient.java | 3 --- .../stratos/cli/RestCommandLineService.java | 27 +++++++------------- 2 files changed, 9 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/8a03dc0b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestClient.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestClient.java b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestClient.java index c4d1b9a..1faee57 100644 --- a/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestClient.java +++ b/components/org.apache.stratos.cli/src/main/java/org/apache/stratos/cli/RestClient.java @@ -59,7 +59,6 @@ public class RestClient implements GenericRestClient{ httpClient = (DefaultHttpClient) WebClientWrapper.wrapClient(httpClient); HttpResponse response = httpClient.execute(postRequest); - System.out.println("Response : " + response.getStatusLine().getStatusCode()); int responseCode = response.getStatusLine().getStatusCode(); if (responseCode == CliConstants.RESPONSE_AUTHORIZATION_FAIL) { @@ -104,8 +103,6 @@ public class RestClient implements GenericRestClient{ httpClient = (DefaultHttpClient) WebClientWrapper.wrapClient(httpClient); HttpResponse response = httpClient.execute(getRequest); - System.out.println("Response : " + response.getStatusLine().getStatusCode()); - if (response.getStatusLine().getStatusCode() != 200) { throw new RuntimeException("Failed : HTTP error code : " + response.getStatusLine().getStatusCode()); } http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/8a03dc0b/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 a4f28dc..edfb15b 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 @@ -466,13 +466,10 @@ public class RestCommandLineService { String result = restClientService.doPost(restClientService.getUrl() + partitionDeploymentEndPoint, partitionDefinition, restClientService.getUsername(), restClientService.getPassword()); - System.out.println(result); - - if (Integer.parseInt(result) == CliConstants.RESPONSE_AUTHORIZATION_FAIL) { - System.out.println("Invalid operations. Authorization failed"); - } - else { + if (result.equals("true")) { System.out.println("You have successfully deployed the partition"); + }else if (Integer.parseInt(result) == CliConstants.RESPONSE_AUTHORIZATION_FAIL) { + System.out.println("Invalid operations. Authorization failed"); } } catch (Exception e) { @@ -485,13 +482,10 @@ public class RestCommandLineService { String result = restClientService.doPost(restClientService.getUrl() + autoscalingPolicyDeploymentEndPoint, autoScalingPolicy, restClientService.getUsername(), restClientService.getPassword()); - System.out.println(result); - - if (Integer.parseInt(result) == CliConstants.RESPONSE_AUTHORIZATION_FAIL) { - System.out.println("Invalid operations. Authorization failed"); - } - else { + if (result.equals("true")) { System.out.println("You have successfully deployed the autoscaling policy"); + }else if (Integer.parseInt(result) == CliConstants.RESPONSE_AUTHORIZATION_FAIL) { + System.out.println("Invalid operations. Authorization failed"); } } catch (Exception e) { @@ -504,13 +498,10 @@ public class RestCommandLineService { String result = restClientService.doPost(restClientService.getUrl() + deploymentPolicyDeploymentEndPoint, deploymentPolicy, restClientService.getUsername(), restClientService.getPassword()); - System.out.println(result); - - if (Integer.parseInt(result) == CliConstants.RESPONSE_AUTHORIZATION_FAIL) { - System.out.println("Invalid operations. Authorization failed"); - } - else { + if (result.equals("true")) { System.out.println("You have successfully deployed the deployment policy"); + }else if (Integer.parseInt(result) == CliConstants.RESPONSE_AUTHORIZATION_FAIL) { + System.out.println("Invalid operations. Authorization failed"); } } catch (Exception e) {
