deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@redhat.com
Subject [PATCH 2/4] Tidy up - move 'address' method (singular) to base driver
Date Thu, 20 Sep 2012 09:53:22 GMT
From: marios <marios@redhat.com>


Signed-off-by: marios <marios@redhat.com>
---
 server/lib/deltacloud/drivers/aruba/aruba_driver.rb | 5 -----
 server/lib/deltacloud/drivers/base_driver.rb        | 5 +++++
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb     | 4 ----
 server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb   | 4 ----
 4 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/server/lib/deltacloud/drivers/aruba/aruba_driver.rb b/server/lib/deltacloud/drivers/aruba/aruba_driver.rb
index 12698db..adfa092 100644
--- a/server/lib/deltacloud/drivers/aruba/aruba_driver.rb
+++ b/server/lib/deltacloud/drivers/aruba/aruba_driver.rb
@@ -248,11 +248,6 @@ class ArubaDriver < Deltacloud::BaseDriver
     end
   end
 
-  def address(credentials, opts={})
-    addrs = addresses(credentials, opts)
-    filter_on(addrs, :id, opts).first
-  end
-
   def create_address(credentials, opts={})
     client = new_client(credentials)
     safely do
diff --git a/server/lib/deltacloud/drivers/base_driver.rb b/server/lib/deltacloud/drivers/base_driver.rb
index 3b37721..068ff59 100644
--- a/server/lib/deltacloud/drivers/base_driver.rb
+++ b/server/lib/deltacloud/drivers/base_driver.rb
@@ -255,6 +255,11 @@ module Deltacloud
       firewalls(credentials, opts).first if has_capability?(:firewalls)
     end
 
+    def address(credentials, opts={})
+      addresses(credentials, opts).first if has_capability?(:addresses)
+    end
+
+
     MEMBER_SHOW_METHODS = [ :realm, :image, :instance, :storage_volume, :bucket, :blob,
                             :key, :firewall ] unless defined?(MEMBER_SHOW_METHODS)
 
diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index 265e231..c7bed05 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -697,10 +697,6 @@ module Deltacloud
           end
         end
 
-        def address(credentials, opts={})
-          addresses(credentials, :id => opts[:id]).first
-        end
-
         def create_address(credentials, opts={})
           ec2 = new_client(credentials)
           safely do
diff --git a/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb b/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
index 18a1e76..666de0c 100644
--- a/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
+++ b/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
@@ -678,10 +678,6 @@ class FgcpDriver < Deltacloud::BaseDriver
     addresses
   end
 
-  def address(credentials, opts={})
-    addresses(credentials, opts).first
-  end
-
   def create_address(credentials, opts={})
     safely do
       client = new_client(credentials)
-- 
1.7.11.4


Mime
View raw message