[ 
https://issues.apache.org/jira/browse/LIBCLOUD-137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13177594#comment-13177594
 ] 

Tomaz Muraus commented on LIBCLOUD-137:
---------------------------------------

OK, let me try to clarify some things again:

1. The thing you see when you do print(node) / repr(node) / str(node) is a 
string representation of the Node object which primary purpose is to help with 
debugging

2. Node object has many more attributes 
(https://github.com/apache/libcloud/blob/trunk/libcloud/compute/base.py#L116) 
which are not included in the string representation to make it more concise. If 
you want to see all the attributes and their values you can do something like 
print node.__dict__

Also, it looks like (judging by your examples), you print the output returned 
by Libcloud and then perform different operations on the output using different 
Unix tools? Is there any particular reason why don't you just use a Python to 
do this?

                
> Return uuid and provider id
> ---------------------------
>
>                 Key: LIBCLOUD-137
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-137
>             Project: Libcloud
>          Issue Type: Improvement
>          Components: Compute
>    Affects Versions: 0.7.1
>            Reporter: Gary Wilson
>              Labels: compute, id,, node, uuid
>
> libcloud.compute.drivers.rackspace.RackspaceUKNodeDriver inherits 
> OpenStack_1_0_NodeDriver and this does not return the required data with 
> regards to node details that are required to manage rackspace nodes, not with 
> the OpenStack driver in any case.  Specifically driver.list.nodes() returns 
> uuid stings for nodes e.g.:
> <Node: uuid=a05c637f548f64d1c847d85abe50bfda46789bec, 
> name=zpf-controller-dev-2-10g-ruk, state=0, public_ips=[xxx.xxx.xxx.xxx'], 
> provider=Rackspace (UK) ...>
> The uuid is not usable in the Rackspace Server or Server Action operations 
> (as defined in their API) as they all require the id parameter.
> The inherited OpenStack ex_rebuild errors with:
> <snip>
> /usr/bin/python /opt/zpf/scripts/libcloud.rebuild.ruk.node $NODE_UUID 
> $NODEIMAGE_UUID
> /opt/zpf/scripts/libcloud.rebuild.ruk.node
> a05c637f548f64d1c847d85abe50bfda46789bec
> 10458692
> Traceback (most recent call last):
>   File "/opt/zpf/scripts/libcloud.rebuild.ruk.node", line 33, in <module>
>     driver.ex_rebuild(sys.argv[1], sys.argv[2])
>   File 
> "/usr/lib/python2.6/site-packages/libcloud/compute/drivers/openstack.py", 
> line 467, in ex_rebuild
>     data=ET.tostring(elm))
>   File 
> "/usr/lib/python2.6/site-packages/libcloud/compute/drivers/openstack.py", 
> line 139, in request
>     method=method, headers=headers)
>   File "/usr/lib/python2.6/site-packages/libcloud/common/openstack.py", line 
> 267, in request
>     return super(OpenStackBaseConnection, self).request(**kwargs)
>   File "/usr/lib/python2.6/site-packages/libcloud/common/base.py", line 509, 
> in request
>     connection=self)
>   File 
> "/usr/lib/python2.6/site-packages/libcloud/compute/drivers/openstack.py", 
> line 242, in __init__
>     super(OpenStack_1_0_Response, self).__init__(*args, **kwargs)
>   File "/usr/lib/python2.6/site-packages/libcloud/common/base.py", line 74, 
> in __init__
>     raise Exception(self.parse_error())
> Exception: 404 Not Found The requested path could not be found.; 
> javax.ws.rs.WebApplicationException: java.lang.NumberFormatException: For 
> input string: "a05c637f548f64d1c847d85abe50bfda46789bec"
> </snip>
> The Rackspace API returns id on all "server" requests e.g.
> wget --no-check-certificate --server-response -O ruk.servers.no.detail 
> --header "X-Auth-Token: xxxxxxxxxxx" 
> https://lon.servers.api.rackspacecloud.com/v1.0/xxxxx/servers
> {"servers":[{"id":10085881,"name":"base-centos-6-ruk"},{"id":10087553,"name":"zpf-controller-dev-1-10g-ruk"},{"id":10087643,"name":"zpf-controller-dev-2-10g-ruk"}]}
> Am I doing something incorrect or is the OpenStack driver not compatible with 
> Rackspace?  If not then surely libcloud should remove Rackspace from this 
> list of Providers.  It would at least save people the time and effort of 
> figuring that out themselves.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to