heat.stacks.list() gets the object instead of the JSON data

Asked by Kevin Duan

I was playing with the openstack heat python API, by executing the following command:

>>> heat.stacks.list()

I was getting the following result:

<generator object paginate at 0x7f25e9deeaf0>

However, I was expecting to have the JSON responses with all the stacks' info.

Any body could help me on this?

Thanks,
Kevin

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu heat Edit question
Assignee:
No assignee Edit question
Solved by:
Kevin Duan
Solved:
Last query:
Last reply:
Revision history for this message
Kevin Duan (kevin-duan) said :
#1

well, it seems it is doing this way intentially... https://bugzilla.redhat.com/show_bug.cgi?id=1042214

And I find the way to print the list:

heat = htclient.Client( endpoint = url, token = keystone.auth_token)
import heatclient.v1.shell as shell
shell.do_stack_list( heat )

here is an example of my openstack lab output:

>>> shell.do_stack_list( heat)
+--------------------------------------+------------+-----------------+----------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+------------+-----------------+----------------------+
| 33917bd5-1c9a-48ca-a4c0-0a76d9d18072 | test | CREATE_COMPLETE | 2014-09-02T18:55:00Z |
+--------------------------------------+------------+-----------------+----------------------+

gee....