[
https://issues.apache.org/jira/browse/DTACLOUD-265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13430972#comment-13430972
]
Michal Fojtik commented on DTACLOUD-265:
----------------------------------------
Sorry for delay, the patch that might fix this issue:
>From e588020f2499efedf22571560ba9966bef73555b Mon Sep 17 00:00:00 2001
From: Michal Fojtik <[email protected]>
Date: Wed, 8 Aug 2012 11:22:57 +0200
Subject: [PATCH core] Core: Prevent hash_capability to fail finding methods
(DTACLOUD-265)
* 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
> Unable to describe in detail key, firewall, realm, image with eucalyptus
> driver
> -------------------------------------------------------------------------------
>
> Key: DTACLOUD-265
> URL: https://issues.apache.org/jira/browse/DTACLOUD-265
> Project: DeltaCloud
> Issue Type: Bug
> Components: Server
> Environment: ubuntu, deltacloud
> Reporter: Deepika Agrawal
> Assignee: David Lutterkort
> Priority: Critical
> Labels: deltacloudd
>
> Hi,
> I tried describing in detail a key, got the below response:
> <error status='404' url='/api/keys/testDC?format=xml'>
> <backend driver='eucalyptus'
> provider='ec2=172.30.54.150;s3=172.30.54.153'></backend>
> <message>Resource not found</message>
> </error>
> At server:
> 172.30.54.46 - - [11/Jul/2012 11:33:57] "GET /api/keys/testDC?format=xml
> HTTP/1.1" 404 192 0.0435
> Similarly, for describing firewall, realm, and image, got the same error.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira