Return-Path: X-Original-To: apmail-airavata-commits-archive@www.apache.org Delivered-To: apmail-airavata-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BA176ED79 for ; Fri, 8 Mar 2013 21:33:19 +0000 (UTC) Received: (qmail 42983 invoked by uid 500); 8 Mar 2013 21:33:19 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 42944 invoked by uid 500); 8 Mar 2013 21:33:19 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 42937 invoked by uid 99); 8 Mar 2013 21:33:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Mar 2013 21:33:19 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Mar 2013 21:33:18 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 39ABF2388847; Fri, 8 Mar 2013 21:32:59 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1454586 - in /airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac: notification/events/EC2ProviderEvent.java provider/impl/EC2Provider.java Date: Fri, 08 Mar 2013 21:32:59 -0000 To: commits@airavata.apache.org From: heshan@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130308213259.39ABF2388847@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: heshan Date: Fri Mar 8 21:32:58 2013 New Revision: 1454586 URL: http://svn.apache.org/r1454586 Log: AIRAVATA-202 Adding proper exception handling and a missing license header. Modified: airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/notification/events/EC2ProviderEvent.java airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/EC2Provider.java Modified: airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/notification/events/EC2ProviderEvent.java URL: http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/notification/events/EC2ProviderEvent.java?rev=1454586&r1=1454585&r2=1454586&view=diff ============================================================================== --- airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/notification/events/EC2ProviderEvent.java (original) +++ airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/notification/events/EC2ProviderEvent.java Fri Mar 8 21:32:58 2013 @@ -1,3 +1,24 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + package org.apache.airavata.gfac.notification.events; public class EC2ProviderEvent extends GFacEvent { Modified: airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/EC2Provider.java URL: http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/EC2Provider.java?rev=1454586&r1=1454585&r2=1454586&view=diff ============================================================================== --- airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/EC2Provider.java (original) +++ airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/EC2Provider.java Fri Mar 8 21:32:58 2013 @@ -167,9 +167,9 @@ public class EC2Provider implements GFac } } catch (InvalidSshKeyException e) { - e.printStackTrace(); + throw new GFacProviderException("Invalid SSH key", e); } catch (IOException e) { - e.printStackTrace(); + throw new GFacProviderException("Error in occurred during IO", e); } } @@ -252,7 +252,8 @@ public class EC2Provider implements GFac return instance; } - private List startInstances(AmazonEC2Client ec2, String amiId, String insType, JobExecutionContext jobExecutionContext) throws AmazonServiceException { + private List startInstances(AmazonEC2Client ec2, String amiId, String insType, JobExecutionContext jobExecutionContext) + throws AmazonServiceException { // start only 1 instance RunInstancesRequest request = new RunInstancesRequest(amiId, 1, 1); request.setKeyName(KEY_PAIR_NAME);