Return-Path: X-Original-To: apmail-deltacloud-dev-archive@www.apache.org Delivered-To: apmail-deltacloud-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 737009180 for ; Thu, 23 Aug 2012 16:36:43 +0000 (UTC) Received: (qmail 92310 invoked by uid 500); 23 Aug 2012 16:36:43 -0000 Delivered-To: apmail-deltacloud-dev-archive@deltacloud.apache.org Received: (qmail 92267 invoked by uid 500); 23 Aug 2012 16:36:43 -0000 Mailing-List: contact dev-help@deltacloud.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@deltacloud.apache.org Delivered-To: mailing list dev@deltacloud.apache.org Received: (qmail 91963 invoked by uid 99); 23 Aug 2012 16:36:43 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Aug 2012 16:36:43 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 9BD942C0A59 for ; Thu, 23 Aug 2012 16:36:42 +0000 (UTC) Date: Fri, 24 Aug 2012 03:36:42 +1100 (NCT) From: "Marios Andreou (JIRA)" To: dev@deltacloud.apache.org Message-ID: <1076671541.6145.1345739802639.JavaMail.jiratomcat@arcas> In-Reply-To: <1482261551.39230.1345638637794.JavaMail.jiratomcat@arcas> Subject: [jira] [Comment Edited] (DTACLOUD-306) can't retrieve instance details with openstack driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DTACLOUD-306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13440379#comment-13440379 ] Marios Andreou edited comment on DTACLOUD-306 at 8/24/12 3:36 AM: ------------------------------------------------------------------ Christian: thanks very much for your input! I was confused at first by your explanation, because I know that the openstack rubygem we are using (and to which deltacloud core developers are the main contributors) actually does something like: [in openstack-1.0.1/lib/compute/server.rb ]: 49 def populate(data=nil)$ 50 path = "/servers/#{URI.encode(@id.to_s)}"$ 51 if data.nil? then$ 52 response = @compute.connection.req("GET", path)$ 53 OpenStack::Exception.raise_exception(response) unless response.code.match(/^20.$/)$ 54 data = JSON.parse(response.body)["server"]$ 55 end$ [...] as you can see in line 50 above, the id passed from deltacloud is already turned into a string. But you are right that the problem is in the 'to_i' from the deltacloud driver... since for example the instance id "2a308316-ee76-4df7-b050-c7de0d18b569" is converted to the integer 2 (the to_i parses the string and extracts whatever leading numbers it can, and returns just 0 if there are none). So the result was that the openstack rubygem was making the call with an instance id of "2". I'll remove the extraneous 'to_i' from the deltacloud driver and run the openstack tests to make sure all is in order before sending the patch here. I'm a little confused that Leander was able to get at specific images though if the same applies to those. [EDIT - its because the 'images' method in the deltacloud openstack driver wasn't invoking 'to_i' for the image ID, but passing it 'as-is' as a string] Thanks again for your input, marios was (Author: marios): Christian: thanks very much for your input! I was confused at first by your explanation, because I know that the openstack rubygem we are using (and to which deltacloud core developers are the main contributors) actually does something like: [in openstack-1.0.1/lib/compute/server.rb ]: 49 def populate(data=nil)$ 50 path = "/servers/#{URI.encode(@id.to_s)}"$ 51 if data.nil? then$ 52 response = @compute.connection.req("GET", path)$ 53 OpenStack::Exception.raise_exception(response) unless response.code.match(/^20.$/)$ 54 data = JSON.parse(response.body)["server"]$ 55 end$ [...] as you can see in line 50 above, the id passed from deltacloud is already turned into a string. But you are right that the problem is in the 'to_i' from the deltacloud driver... since for example the instance id "2a308316-ee76-4df7-b050-c7de0d18b569" is converted to the integer 2 (the to_i parses the string and extracts whatever leading numbers it can, and returns just 0 if there are none). So the result was that the openstack rubygem was making the call with an instance id of "2". I'll remove the extraneous 'to_i' from the deltacloud driver and run the openstack tests to make sure all is in order before sending the patch here. I'm a little confused that Leander was able to get at specific images though if the same applies to those. Thanks again for your input, marios > can't retrieve instance details with openstack driver > ----------------------------------------------------- > > Key: DTACLOUD-306 > URL: https://issues.apache.org/jira/browse/DTACLOUD-306 > Project: DeltaCloud > Issue Type: Bug > Reporter: Marios Andreou > Assignee: Marios Andreou > Attachments: 0001-Fix-for-DTACLOUD_306-Openstack-server-ID-should-be-p.patch > > > NOTE: AS REPORTED BY Leander Bessa Beernaert to dev@deltacloud.apache.org mailing list: > I've been tasked to look at Deltacloud, in particular the OpenStack driver. > I have a small OpenStack setup running with OpenStack Essex on Ubuntu > 12.04. Each time i try to see an instance in detail i get the following > error: > OpenStack::Exception::ItemNotFound:The resource could not be found. > /var/lib/gems/1.9.1/gems/openstack-1.0.1/lib/openstack/connection.rb:436:in `raise_exception' > /var/lib/gems/1.9.1/gems/openstack-1.0.1/lib/openstack/connection.rb:189:in `req' > /var/lib/gems/1.9.1/gems/openstack-1.0.1/lib/openstack/compute/server.rb:52:in `populate' > /var/lib/gems/1.9.1/gems/openstack-1.0.1/lib/openstack/compute/server.rb:37:in `initialize' > /var/lib/gems/1.9.1/gems/openstack-1.0.1/lib/openstack/compute/connection.rb:28:in `new' > /var/lib/gems/1.9.1/gems/openstack-1.0.1/lib/openstack/compute/connection.rb:28:in `get_server' > /var/lib/gems/1.9.1/gems/deltacloud-core-1.0.1/lib/deltacloud/drivers/openstack/openstack_driver.rb:122:in `block in instances' > /var/lib/gems/1.9.1/gems/deltacloud-core-1.0.1/lib/deltacloud/drivers/exceptions.rb:181:in `call' > /var/lib/gems/1.9.1/gems/deltacloud-core-1.0.1/lib/deltacloud/drivers/exceptions.rb:181:in `safely' > /var/lib/gems/1.9.1/gems/deltacloud-core-1.0.1/lib/deltacloud/drivers/openstack/openstack_driver.rb:120:in `instances' > /var/lib/gems/1.9.1/gems/deltacloud-core-1.0.1/lib/deltacloud/drivers/base_driver.rb:217:in `instance' -- 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