deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobias Crawley <tcraw...@redhat.com>
Subject [PATCH 1/2] Move actual capability test out to its own method.
Date Tue, 09 Nov 2010 13:25:11 GMT
---
 server/lib/deltacloud/backend_capability.rb |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/server/lib/deltacloud/backend_capability.rb b/server/lib/deltacloud/backend_capability.rb
index bec8714..4e6b6a4 100644
--- a/server/lib/deltacloud/backend_capability.rb
+++ b/server/lib/deltacloud/backend_capability.rb
@@ -13,8 +13,12 @@ module Deltacloud::BackendCapability
     @capability = capability
   end
 
+  def has_capability?(backend)
+    !capability or backend.respond_to?(capability)
+  end
+  
   def check_capability(backend)
-    if capability and !backend.respond_to?(capability)
+    if !has_capability?(backend)
       raise Failure.new(capability, "#{capability} capability not supported by backend #{backend.class.name}")
     end
   end
-- 
1.7.2.3


Mime
View raw message