<div dir="ltr"><div><div><div><div>Thanks Pavlo. <br><br></div>One particular thing I did not comprehend is: <br><br></div>Suppose my resource code is something like:<br><br></div><br>class HelloWorld(resource.Resource):<br> def __init__(self, controller, deserializer, serializer=None):<br> LOG.info("[pradipm]:Inside HelloWorld ctor");<br> resource.Resource.__init__(self, controller, deserializer, serializer)<br> ## Re-setting the data value<br> self._data_value = self.properties['value']<br><br> properties_schema = {<br> 'value': properties.Schema(<br> properties.Schema.STRING,<br> _('foo')<br> ),<br> }<br><br> attributes_schema = {<br> 'data': _('the data')<br> }<br><br> ...........<br> def _set_param_values(self):<br> LOG.info("[pradipm]:Inside _set_param_values")<br> self._data_value = self.properties['value']<br> return<br><br> def handle_create(self):<br> LOG.info("[pradipm]:Inside handle_create")<br> container_id = 1 ## some arbitrary id<br> self.resource_id_set(container_id)<br> self._set_param_values()<br> return container_id<br><br><br><br></div><div>I am seeing the constructor is getting called *later on* compared to the handle_create -> check_create_complete etc. <br><br></div><div>Is that a *defined* behavior? Or it is purely *temporal* (such that in some cases the ctor might be called early also).<br><br><br><br><br></div><div>Thanks,<br></div><div>Pradip<br><br><br></div><div><br></div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 26, 2014 at 4:05 PM, Pavlo Shchelokovskyy <span dir="ltr"><<a href="mailto:pshchelokovskyy@mirantis.com" target="_blank">pshchelokovskyy@mirantis.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Pradip,<div><br></div><div><a href="https://github.com/openstack/heat/blob/master/heat/engine/resource.py#L473" target="_blank">https://github.com/openstack/heat/blob/master/heat/engine/resource.py#L473</a><br></div><div><br></div><div>Basically, it calls handle_create that might return some data, yields, and than keeps calling check_create_complete with that data returned by handle_create, yielding control in-between, until check_create_complete returns True.</div><div><br></div><div>Best regards,</div><div>Pavlo Shchelokovskyy.</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Nov 26, 2014 at 12:20 PM, Pradip Mukhopadhyay <span dir="ltr"><<a href="mailto:pradip.interra@gmail.com" target="_blank">pradip.interra@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div><div><div>Hello,<br><br><br></div><br>Any pointer (document and/or code pointer) related to how the different overridden methods are getting called when a custom resource is getting deployed in the heat stack?<br><br></div><br>Basically just tried to annotate the h-eng log on a simple, very-first-attempt 'hello world' resource. Noticed the log is something like:<br><br>2014-11-26 15:38:30.251 INFO heat.engine.plugins.helloworld [-] [pradipm]:Inside handle_create<br>2014-11-26 15:38:30.257 INFO heat.engine.plugins.helloworld [-] [pradipm]:Inside _set_param_values<br>2014-11-26 15:38:31.259 INFO heat.engine.plugins.helloworld [-] [pradipm]:Inside check_create_complete<br>2014-11-26 15:38:44.227 INFO heat.engine.plugins.helloworld [req-9979deb9-f911-4df4-bdf8-ecc3609f054b None demo] [pradipm]:Inside HelloWorld ctor<br>2014-11-26 15:38:44.234 INFO heat.engine.plugins.helloworld [req-9979deb9-f911-4df4-bdf8-ecc3609f054b None demo] [pradipm]:Inside _resolve_attribute<br><br><br><br><br></div>The constructor (ctor) is getting called in the flow after the create-resource. So though understanding the flow would help.<br><br><br><br></div>Thanks in advance,<br>Pradip<br><br></div>
<br></div></div>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr">Pavlo Shchelokovskyy<div>Software Engineer</div><div>Mirantis Inc</div><div><a href="http://www.mirantis.com" target="_blank">www.mirantis.com</a></div></div></div>
</font></span></div>
<br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div>