euca2ools does not respect the --region option correctly

Bug #980940 reported by Andrew Glen-Young on 2012-04-13
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
euca2ools
New
Undecided
Unassigned
euca2ools (Ubuntu)
Wishlist
Unassigned

Bug Description

The euc2ools commands do not support the --region flag for anything other than EC2. I would like to define multiple regions and use these commands against Eucalyptus and Openstack clouds (among others).

Currently the endpoint URL is hardcoded (see the function below).

/usr/lib/pyshared/euca2ools/commands/eucacommand.py:

    def get_endpoint_url(self, region_name):
        """
        Get the URL needed to reach a region with a given name.

        This currently only works with EC2. In the future it may use other
        means to also work with Eucalyptus.
        """
        endpoint_template = 'https://ec2.%s.amazonaws.com/'
        endpoint_url = endpoint_template % region_name
        endpoint_dnsname = urlparse.urlparse(endpoint_url).hostname
        try:
            socket.getaddrinfo(endpoint_dnsname, None)
        except socket.gaierror:
            raise KeyError('Cannot resolve endpoint %s' % endpoint_dnsname)
        return endpoint_url

System information:

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu precise (development branch)"

$ dpkg-query --show euca2ools
euca2ools 2.0.0~bzr516-0ubuntu3

tags: added: canonistack
Scott Moser (smoser) wrote :

My fix for the hard coded region list at
http://bazaar.launchpad.net/~smoser/euca2ools/remove-regionlist/revision/496 actually had the ability to do this.

upstream euca2ools didn't like the specific solution, so I pulled it from ubuntu rather than having delta.

James Page (james-page) on 2012-04-27
Changed in euca2ools (Ubuntu):
importance: Undecided → Wishlist
status: New → Triaged
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers