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 726A4DC7D for ; Mon, 1 Oct 2012 08:58:39 +0000 (UTC) Received: (qmail 74414 invoked by uid 500); 1 Oct 2012 08:58:39 -0000 Delivered-To: apmail-deltacloud-dev-archive@deltacloud.apache.org Received: (qmail 74304 invoked by uid 500); 1 Oct 2012 08:58:39 -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 74286 invoked by uid 99); 1 Oct 2012 08:58:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Oct 2012 08:58:38 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mfojtik@redhat.com designates 209.132.183.28 as permitted sender) Received: from [209.132.183.28] (HELO mx1.redhat.com) (209.132.183.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Oct 2012 08:58:32 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q918wAck026352 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 1 Oct 2012 04:58:10 -0400 Received: from dhcp-29-121.brq.redhat.com (dhcp-29-121.brq.redhat.com [10.34.29.121]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q918w8lI014325 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 1 Oct 2012 04:58:10 -0400 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.1 \(1498\)) Subject: Re: NoMethodError - undefined method `underscore' for CIMI::Model::ResourceMetadata:Class From: Michal Fojtik In-Reply-To: <1349062708.24408.6.camel@avon.watzmann.net> Date: Mon, 1 Oct 2012 10:58:57 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <0D470673-2420-4E64-911D-8CE6C1D8F99C@redhat.com> References: <434A0ECB689CAF49A3A2321F30F2AB8322CDD4D5@FALEX03.au.fjanz.com> <1349062708.24408.6.camel@avon.watzmann.net> To: dev@deltacloud.apache.org X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 On Oct 1, 2012, at 5:38 AM, David Lutterkort wrote: The patch is easy: =3D=3D=3D=3D SNIP =3D=3D=3D=3D=3D diff --git a/clients/cimi/lib/entities/cloud_entry_point.rb = b/clients/cimi/lib/entities/cloud_entry_point.rb index 94225f7..b8fa448 100644 --- a/clients/cimi/lib/entities/cloud_entry_point.rb +++ b/clients/cimi/lib/entities/cloud_entry_point.rb @@ -18,7 +18,9 @@ class CIMI::Frontend::CloudEntryPoint < = CIMI::Frontend::Entity get '/cimi/cloudEntryPoint' do entry_point_xml =3D get_entity_collection('cloudEntryPoint', = credentials) @entry_point =3D = CIMI::Model::CloudEntryPoint.from_xml(entry_point_xml) - @entities =3D CIMI::Model::root_entities.map { |e| = e.underscore.downcase }.reject{|col| @entry_point[col].hr + @entities =3D CIMI::Model::root_entities.map do |e| + e.name.split('::').last.pluralize.underscore.downcase + end.reject{|col| @entry_point[col].href.nil?} haml :'cloud_entry_point/index' end =3D=3D=3D=3D SNIP =3D=3D=3D=3D=3D Unfortunately the CIMI client is now pretty broken because we're = implementing more CIMI entities and making the CIMI frontend compatible with v1.0. So if you apply this patch, then you will get another error... I think = David is now working on fixing this, so hopefully we will have proper patch for = the client soon. > My bad .. I broke that with c6b642b0; CIMI::Model::root_entities is = now > an array of classes, rather than an array of names. To get the old > array, you'll need to do something like >=20 > CIMI::Model::root_entites.map do |klass| > klass.name.split('::').last.pluralize.underscore > end >=20 > Unfortunately, this week looks pretty bad for me to come up with a > proper fix; but if somebody else could cook up a patch, it would be = much > appreciated. >=20 > David >=20 > On Sat, 2012-09-29 at 18:02 +1000, Koper, Dies wrote: >> ruby bin\start -u http://localhost:3001/cimi >>=20 >> then access http://localhost:4001/cimi/cloudEntryPoint >> gives me: >>=20 >> NoMethodError - undefined method `underscore' for >> CIMI::Model::ResourceMetadata:Class: >> bin/../lib/entities/cloud_entry_point.rb:21:in `GET >> /cimi/cloudEntryPoint' >> bin/../lib/entities/cloud_entry_point.rb:21:in `map' >>=20 >> Why? >>=20 >> Server was started with ruby bin\deltacloudd -i fgcp -f cimi >> And seems to have handled the request successfully: >>=20 >> 127.0.0.1 - - [29/Sep/2012 17:55:01] "GET /cimi/cloudEntryPoint >> HTTP/1.1" 200 861 0.0090 >>=20 >> This is on Windows 7 with ruby 1.8.7 (2012-02-08 patchlevel 358) >> [i386-mingw32] >> And I ran bundle in the server and cimi client directories before >> running the commands. >>=20 >> Cimi client: >>=20 >> Gems included by the bundle: >> * bundler (1.0.22) >> * haml (3.1.7) >> * json (1.7.5) >> * mime-types (1.19) >> * nokogiri (1.5.5) >> * rack (1.4.1) >> * rack-accept (0.4.5) >> * rack-protection (1.2.0) >> * rest-client (1.6.7) >> * sinatra (1.3.3) >> * sinatra-content-for (0.1) >> * tilt (1.3.3) >>=20 >> Server: >>=20 >> Gems included by the bundle: >> * addressable (2.3.2) >> * akami (1.2.0) >> * aws (2.5.7) >> * builder (3.1.3) >> * bundler (1.0.22) >> * cloudfiles (1.5.0.1) >> * cloudservers (0.4.2) >> * crack (0.3.1) >> * daemons (1.1.9) >> * deltacloud-core (1.0.3) >> * eventmachine (1.0.0) >> * excon (0.16.4) >> * fog (1.6.0) >> * formatador (0.2.3) >> * gyoku (0.4.6) >> * haml (3.1.7) >> * http_connection (1.4.1) >> * httpi (1.1.1) >> * jruby-pageant (1.1.1) >> * json (1.7.5) >> * mime-types (1.19) >> * minitest (4.0.0) >> * multi_json (1.3.6) >> * net-scp (1.0.4) >> * net-ssh (2.6.0) >> * nokogiri (1.5.5) >> * nori (1.1.3) >> * openstack (1.0.6) >> * rack (1.4.1) >> * rack-accept (0.4.5) >> * rack-protection (1.2.0) >> * rack-test (0.6.2) >> * rake (0.9.2.2) >> * rbovirt (0.0.12) >> * rbvmomi (1.6.0) >> * require_relative (1.0.3) >> * rest-client (1.6.7) >> * ruby-hmac (0.4.0) >> * savon (1.2.0) >> * simplecov (0.6.4) >> * simplecov-html (0.5.3) >> * sinatra (1.3.3) >> * sinatra-rabbit (1.1.2) >> * thin (1.5.0) >> * tilt (1.3.3) >> * trollop (2.0) >> * uuidtools (2.1.3) >> * vcr (2.2.5) >> * wasabi (2.5.1) >> * waz-storage (1.1.4) >> * webmock (1.8.11) >> * xml-simple (1.1.1) >>=20 >> Cheers, >> Dies Koper >>=20 >>=20 >=20 >=20 >=20 Michal Fojtik http://deltacloud.org mfojtik@redhat.com