Ask Your Question
0

How to create stack with python SDK

asked 2014-07-30 09:45:45 -0500

Goblja gravatar image

updated 2014-07-30 14:06:50 -0500

smaffulli gravatar image

Hello,

I have went through this guide http://docs.openstack.org/user-guide/... and have created python script that creates instances.

Is it possible to create stack with such method. I installed python-heatclient and tried to run python script. script:

#!/usr/bin/python
# -*- coding: utf-8 -*- from credentials import get_keystone_creds
from heatclient.client import Client

try:
    credentials = get_keystone_creds()
    #heat = Client('1', endpoint=heat_url, token=auth_token)
    heat = Client('1', endpoint="http://192.168.56.101:8004/v1/790b1d67c83347b0aeb6cca826dd6b7a",
token="admin")

    print("Heat List")
    print(heat.stacks.list())

finally:
    print("Execution Completed")

But I get message: <generator object="" paginate="" at="" 0x2a0e0a0="">

what i am doing wrong?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2017-01-18 06:40:06 -0500

A Verma gravatar image

Hey, I know its late for reply but here you go: Do print using next() because output is not list but generator. print(next(heat.stacks.list()))

edit flag offensive delete link more
0

answered 2014-08-01 08:52:21 -0500

Goblja gravatar image

So I understand why this message was created. heat.staks.list is returned as an object and to print list we have to use print function : utils.print_list(stacks, fields, sortby_index=3)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-07-30 09:45:45 -0500

Seen: 776 times

Last updated: Jan 18 '17