From: Michal Fojtik <[email protected]> * When the driver inherits its methods from other driver, the has_capability failed to find them, which cause to not advertise them.
Signed-off-by: Michal fojtik <[email protected]> --- server/lib/deltacloud/drivers/base_driver.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/lib/deltacloud/drivers/base_driver.rb b/server/lib/deltacloud/drivers/base_driver.rb index 21e4382..30d0f92 100644 --- a/server/lib/deltacloud/drivers/base_driver.rb +++ b/server/lib/deltacloud/drivers/base_driver.rb @@ -157,7 +157,11 @@ module Deltacloud def has_capability?(method) method = (RUBY_VERSION =~ /^1\.9/) ? method : method.to_s - (self.class.instance_methods - self.class.superclass.instance_methods).include? method + # Prevent has_capability fail when driver is inherited from another + # driver, like Eucalyptus + superclass_methods = self.class.superclass.name == 'Deltacloud::BaseDriver' ? + self.class.superclass.instance_methods : [] + (self.class.instance_methods - superclass_methods).include? method end ## Capabilities -- 1.7.10.2
