How to pass an object reference to handle_delete? [closed]

asked 2014-09-02 04:02:58 -0500

my_openstack_username gravatar image

updated 2014-09-04 03:05:58 -0500

Regarding Heat resource plugins, as far as i can tell, handle_delete method is called in a different instance of the resource class than handle_create?

If this is correct, how could i pass a reference to an instance of another class (or the Python equivalent) to this method? I’ve tried through data_set()/data().get() to no avail.

Reason for this is because my handle_create creates a thread with some process, that I should then terminate through handle_delete.

Edit

Does Heat provide some mechanism for plug-ins to run some code periodically?

UPDATE

There are currently two ways of having a Heat resource run something periodically:

  • Have a Ceilometer alarm, that always evaluates as true, repeatedly signal the resource and have the code called by handle_signal
  • Create an instance and run the code as a cron job on it.

The existing periodic task mechanism within Heat is deprecated and should not be used.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by larsks
close date 2014-09-04 08:12:36.839295

Comments

I don't think Heat plugins are meant to maintain state like this. Someone should be able to restart the Heat engine without affecting any running stacks.

larsks gravatar imagelarsks ( 2014-09-03 21:28:10 -0500 )edit
1

You may want to try asking the same thing in #heat on Freenode, where the heat devs hang out.

larsks gravatar imagelarsks ( 2014-09-03 21:31:34 -0500 )edit

@larsks Thanks, I did that and updated the question with the answers.

my_openstack_username gravatar imagemy_openstack_username ( 2014-09-04 03:07:31 -0500 )edit