I was able to accomplish what I need just by adding a new key to the extra
dict but I'm not sure that's the most intuitive place for it. Plus, a
separate driver may be a good idea anyway because to really support
servers built this way libcloud should wait for the post-build automation
to run before calling it complete.

diff --git a/libcloud/compute/drivers/openstack.py
b/libcloud/compute/drivers/openstack.py
index 648d451..1aea25f 100644
--- a/libcloud/compute/drivers/openstack.py
+++ b/libcloud/compute/drivers/openstack.py
@@ -1716,6 +1716,7 @@ class OpenStack_1_1_NodeDriver(OpenStackNodeDriver):
             driver=self,
             extra=dict(
        hostId=api_node['hostId'],
+       access_ips=api_node.get('accessIPv4'),
        # Docs says "tenantId", but actual is "tenant_id". *sigh*
        # Best handle both.
        tenantId=api_node.get('tenant_id') or api_node['tenantId'],


Here's a PR for this change:
https://github.com/apache/libcloud/pull/140/files


-----Original Message-----
From: Tomaz Muraus <[email protected]>
Reply-To: "[email protected]" <[email protected]>
Date: Sunday, September 1, 2013 12:44 PM
To: dev <[email protected]>
Subject: Re: [dev] Rackspace Rackconnect support in Libcloud

>Yeah what Alex said. I'm also not aware of an existing Rack Connect
>driver.
>
>How we should proceed depends on how much do you need to extend the base
>OpenStack driver:
>
>1. If you need to add a bunch of new functionality and extension methods,
>then we should create a new RackConnect driver which inherits from the
>OpenStack one and add RackConnect specific functionality there.
>
>2. If you just need "accessIPv4" value (I would imagine this is an
>internal
>/ service net IP address), in this case I'm fine with modifying base
>OpenStack driver to look for this attribute and add it to node.private_ips
>list if it exists.
>
>
>On Sun, Sep 1, 2013 at 7:19 PM, Alex Gaynor <[email protected]> wrote:
>
>> Hey Chris,
>>
>> I don't believe anyone is currently working on this. I'm not super
>>familiar
>> with the APIs for interacting with Rackconnect, but when you send the PR
>> I'm happy to take a look to see if the way it's integrated looks right
>>for
>> libcloud.
>>
>> Alex
>>
>>
>> On Sun, Sep 1, 2013 at 10:02 AM, Chris Johnson <
>> [email protected]> wrote:
>>
>> > Hello,
>> >
>> > I've recently been working on a project where we needed to use
>>salt-cloud
>> > to provision servers in a Rackspace cloud environment with
>>Rackconnect.
>> To
>> > accomplish that I extended the libcloud/compute/drivers/openstack.py
>> > driver to provide the accessIPv4 value from the instance details.
>> >
>> > If I had a need for it I would image others would as well but before I
>> > submitted a pull request I thought I would check here first to see if
>> that
>> > work is already being done somewhere else or if there's a better
>> approach.
>> >
>> > Chris Johnson
>> >
>> >
>>
>>
>> --
>> "I disapprove of what you say, but I will defend to the death your
>>right to
>> say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
>> "The people's good is the highest law." -- Cicero
>> GPG Key fingerprint: 125F 5C67 DFE9 4084
>>
>


Reply via email to