deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject git commit: EC2: Return HTTP_NOT_FOUND when deleting non-existing load-balancer (DTACLOUD-169)
Date Wed, 09 May 2012 13:37:27 GMT
Updated Branches:
  refs/heads/master 3b7ba1ce5 -> c3dd00f17


EC2: Return HTTP_NOT_FOUND when deleting non-existing load-balancer (DTACLOUD-169)


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

Branch: refs/heads/master
Commit: c3dd00f17ad45633bd61357d4168d30f3e099dac
Parents: 3b7ba1c
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Wed May 9 15:37:50 2012 +0200
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Wed May 9 15:37:50 2012 +0200

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/c3dd00f1/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index 7d2d018..808b2b2 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -377,6 +377,7 @@ module Deltacloud
 
         def destroy_load_balancer(credentials, id)
           ec2 = new_client( credentials, :elb )
+          return 'InvalidLoadBalancer' if load_balancer(credentials, :id => id).nil?
           safely do
             ec2.delete_load_balancer(id)
           end
@@ -1047,7 +1048,11 @@ module Deltacloud
             status 401
           end
 
-          on /(NotFound|InvalidInstanceID|InvalidAMIID)/ do
+          on /(NotFound|InvalidInstanceID|InvalidAMIID|InvalidLoadBalancer|LoadBalancerNotFound)/
do
+            status 404
+          end
+
+          on /Bad Request.*elasticloadbalancing/ do
             status 404
           end
 


Mime
View raw message