[
https://issues.apache.org/jira/browse/DTACLOUD-574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13705881#comment-13705881
]
Andrew Brady commented on DTACLOUD-574:
---------------------------------------
Notes from IRC for fixing issue. I'll try to get to it today.
<inspectrum> marios, (and others who were on the call): this is the model I'm
looking at, I don't see the "ip" attribute you're talking about:
https://git-wip-us.apache.org/repos/asf?p=deltacloud.git;a=blob;f=server/lib/deltacloud/models/address.rb;h=44d39242663baa6b4a08d104bff6231336af173d;hb=HEAD
<inspectrum> Am I perhaps looking at the wrong data model?
<marios> inspectrum: you're right - looks like it's just added in the xml
serialization. can you add a comment to the jira ticket. i'll try and address
that asap
<marios> mfojtik: ^^
<inspectrum> I do see it in the client model
<mfojtik> looking
<mfojtik> so he 'ip' exists in client model but not in dc model?
<mfojtik> k, then I think the fix could be to add 'attr_accessor :ip' to
Address in Deltacloud and set it in openstack driver
<mfojtik> also set it to 'id' by default
<mfojtik> also worth to check the HAML view / json
<marios> mfojtik: i think ip is just added in xml view
<marios> mfojtik: it isn't defined in the model
<mfojtik>
https://git-wip-us.apache.org/repos/asf?p=deltacloud.git;a=blob;f=server/views/addresses/show.xml.haml;h=28d8b6d92a90bc443e951823d3da7e4257ded895;hb=HEAD
<mfojtik> %ip< 5 =address.id
<mfojtik> this is wrong :)
<marios> mfojtik: right :)
<marios> mfojtik: err.. wrong :)
<mfojtik> should be address.ip (but you need to add the 'ip' attibute)
<marios> mfojtik: exactly
<mfojtik> = address.ip || address.id
<mfojtik> :-)
<mfojtik> (to make it backward compatible)
> Address Model should allow the use of an actual identifier for an instance
> instead of just the IP
> -------------------------------------------------------------------------------------------------
>
> Key: DTACLOUD-574
> URL: https://issues.apache.org/jira/browse/DTACLOUD-574
> Project: DeltaCloud
> Issue Type: Bug
> Components: Server
> Reporter: Andrew Brady
> Priority: Minor
> Labels: easyfix
>
> The model for Address doesn't support setting both the address and the id.
> And, since it doesn't support setting the href it doesn't allow accessing an
> address specifically by id (which is how you would do it in OpenStack).
> Even just making the "to_hash" method on Address use a ternary on href and
> making that attribute settable would be an acceptable solution. The only real
> use case is to be able to retrieve address details for an individual address.
> An example from mock driver:
> <address href="http://localhost:3001/api/addresses/192.168.0.4"
> id="192.168.0.4"><ip>192.168.0.4</ip><actions><link
> href="http://localhost:3001/api/addresses/192.168.0.4" method="delete"
> rel="destroy"/><link
> href="http://localhost:3001/api/addresses/192.168.0.4/associate"
> method="post" rel="associate"/></actions></address>
> But 192.168.0.4 isn't an id, it's an IP
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira