Return-Path: Delivered-To: apmail-incubator-deltacloud-dev-archive@minotaur.apache.org Received: (qmail 41230 invoked from network); 15 Dec 2010 01:00:29 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 15 Dec 2010 01:00:29 -0000 Received: (qmail 43984 invoked by uid 500); 15 Dec 2010 01:00:29 -0000 Delivered-To: apmail-incubator-deltacloud-dev-archive@incubator.apache.org Received: (qmail 43906 invoked by uid 500); 15 Dec 2010 01:00:29 -0000 Mailing-List: contact deltacloud-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: deltacloud-dev@incubator.apache.org Delivered-To: mailing list deltacloud-dev@incubator.apache.org Received: (qmail 43898 invoked by uid 99); 15 Dec 2010 01:00:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Dec 2010 01:00:29 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=10.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lutter@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; Wed, 15 Dec 2010 01:00:22 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oBF101Ol001028 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 14 Dec 2010 20:00:01 -0500 Received: from [10.3.113.121] (ovpn-113-121.phx2.redhat.com [10.3.113.121]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oBF101jP022549 for ; Tue, 14 Dec 2010 20:00:01 -0500 Subject: Re: [PATCH core] Allow setting the provider on the server side, and implement region overriding in the ec2 driver based off of the provider (rev 2). From: David Lutterkort To: deltacloud-dev@incubator.apache.org In-Reply-To: <1291986394-10944-1-git-send-email-tcrawley@redhat.com> References: <1291986394-10944-1-git-send-email-tcrawley@redhat.com> Content-Type: text/plain; charset="ISO-8859-15" Organization: Red Hat Inc Date: Tue, 14 Dec 2010 17:00:01 -0800 Message-ID: <1292374801.4244.146.camel@avon.watzmann.net> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 On Fri, 2010-12-10 at 08:06 -0500, tcrawley@redhat.com wrote: > From: Tobias Crawley > > The provider can now be set on the commandline to deltacloudd via -P/--provider > (putting it in ENV['API_PROVIDER']), and also from the client via a header > (putting it in Thread.current[:provider]). > > The ec2 driver is currently the only driver that understands providers, and > looks in Thread.current[:provider], then ENV['API_PROVIDER'], then falls back > to a default (currently 'us-east-1', the AWS default). Sorry for being late to the party; the word 'provider' seems very unclear to me. In addition, the driver does some scary URL surgery that seems less than robust to me. I'd prefer if we rename this mechanism into 'endpoint' (and ENV['API_ENDPOINT']) with the expectation that the entire URL that we should talk to is passed in. With that, it also becomes possible to use the EC2 driver against a private Eucalyptus instance. > + def endpoint_for_service(service) > + url = "" > + url << case service > + when :ec2 > + 'ec2.' > + when :elb > + 'elasticloadbalancing.' > + end > + url << (Thread.current[:provider] || ENV['API_PROVIDER'] || DEFAULT_REGION) > + url << '.amazonaws.com' > + url > + end This is the code I object to; and as I said, the URL surgery restricts unnecessarily how the EC2 driver can be used. David