Ask Your Question

i am trying to do operations like if heat stack-list | grep $STACK_NAME | grep "CREATE_COMPLETE"

asked 2016-06-16 20:08:44 -0600

krishn gravatar image

i am trying to do operations like if heat stack-list | grep $STACK_NAME | grep "CREATE_COMPLETE" in python.

But it needs knoweledge on python binding with openstack. Can you guys help me doing this kind of solution. how heat stack-list is used in python.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-06-23 07:22:50 -0600

teju gravatar image

1.Please follow the instructions in the below link
  1. List all the stacks

    stacks = heat.stacks.list()

  2. Iterate through the stacks to search for stacks with status "CREATE_COMPLETE"

    for stack in stacks: if stack.status == "CREATE_COMPLETE": print stack

I've pasted the full code in the below link:

Please replace the values of tenant_id, heat_url, auth_token , etc

edit flag offensive delete link more


Thank you. This make lot of sense.

krishn gravatar imagekrishn ( 2016-06-23 09:13:35 -0600 )edit

If this works, accept the answer and close the question

teju gravatar imageteju ( 2016-06-24 04:22:20 -0600 )edit

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


Asked: 2016-06-16 20:08:44 -0600

Seen: 112 times

Last updated: Jun 23 '16