)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6488,"name":"Clint Byrum","email":"clint@fewbar.com","username":"clint-fewbar"},"change_message_id":"230a117bbe01f92fc8cfa087baf8aa9d0fa44a71","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Adding own child_template for AutoScalingGroup"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Resource AutoScalingGroup fails during preview, because uses parent"},{"line_number":10,"context_line":"child_template function function with invalid property Size. So"},{"line_number":11,"context_line":"AutoScalingGroup should has own child_template with correct properties."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"1ae5cdf2_e2b81bca","line":9,"updated":"2014-06-12 22:19:47.000000000","message":"s/because uses parent/because it uses the parent/","commit_id":"685fc66f3d0a4235cdb1ba1c7701c9d187e55aca"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"3a014c24345212f13248707b7761163e1fbc4a46","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Adding own child_template for AutoScalingGroup"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Resource AutoScalingGroup fails during preview, because uses parent"},{"line_number":10,"context_line":"child_template function function with invalid property Size. So"},{"line_number":11,"context_line":"AutoScalingGroup should has own child_template with correct properties."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"1ae5cdf2_cf3f7686","line":9,"in_reply_to":"1ae5cdf2_e2b81bca","updated":"2014-06-16 13:58:23.000000000","message":"Done","commit_id":"685fc66f3d0a4235cdb1ba1c7701c9d187e55aca"},{"author":{"_account_id":6488,"name":"Clint Byrum","email":"clint@fewbar.com","username":"clint-fewbar"},"change_message_id":"230a117bbe01f92fc8cfa087baf8aa9d0fa44a71","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Adding own child_template for AutoScalingGroup"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Resource AutoScalingGroup fails during preview, because uses parent"},{"line_number":10,"context_line":"child_template function function with invalid property Size. So"},{"line_number":11,"context_line":"AutoScalingGroup should has own child_template with correct properties."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I0068c1eaf19464c39348823160b665f538fec583"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"1ae5cdf2_02bc27ba","line":10,"updated":"2014-06-12 22:19:47.000000000","message":"s/function function/function/\ns/with invalid/with an invalid/","commit_id":"685fc66f3d0a4235cdb1ba1c7701c9d187e55aca"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"3a014c24345212f13248707b7761163e1fbc4a46","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Adding own child_template for AutoScalingGroup"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Resource AutoScalingGroup fails during preview, because uses parent"},{"line_number":10,"context_line":"child_template function function with invalid property Size. So"},{"line_number":11,"context_line":"AutoScalingGroup should has own child_template with correct properties."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I0068c1eaf19464c39348823160b665f538fec583"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"1ae5cdf2_ef44321d","line":10,"in_reply_to":"1ae5cdf2_02bc27ba","updated":"2014-06-16 13:58:23.000000000","message":"Done","commit_id":"685fc66f3d0a4235cdb1ba1c7701c9d187e55aca"},{"author":{"_account_id":6488,"name":"Clint Byrum","email":"clint@fewbar.com","username":"clint-fewbar"},"change_message_id":"230a117bbe01f92fc8cfa087baf8aa9d0fa44a71","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Resource AutoScalingGroup fails during preview, because uses parent"},{"line_number":10,"context_line":"child_template function function with invalid property Size. So"},{"line_number":11,"context_line":"AutoScalingGroup should has own child_template with correct properties."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I0068c1eaf19464c39348823160b665f538fec583"},{"line_number":14,"context_line":"Closes-Bug: #1322583"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"1ae5cdf2_42b2afe5","line":11,"updated":"2014-06-12 22:19:47.000000000","message":"s/should has own/should have its own/","commit_id":"685fc66f3d0a4235cdb1ba1c7701c9d187e55aca"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"3a014c24345212f13248707b7761163e1fbc4a46","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Resource AutoScalingGroup fails during preview, because uses parent"},{"line_number":10,"context_line":"child_template function function with invalid property Size. So"},{"line_number":11,"context_line":"AutoScalingGroup should has own child_template with correct properties."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I0068c1eaf19464c39348823160b665f538fec583"},{"line_number":14,"context_line":"Closes-Bug: #1322583"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"1ae5cdf2_0f495e32","line":11,"in_reply_to":"1ae5cdf2_42b2afe5","updated":"2014-06-16 13:58:23.000000000","message":"Done","commit_id":"685fc66f3d0a4235cdb1ba1c7701c9d187e55aca"}],"heat/engine/resources/autoscaling.py":[{"author":{"_account_id":6800,"name":"Christopher Armstrong","email":"chris.armstrong@rackspace.com","username":"radix"},"change_message_id":"7643a798d214be316bbd9e5ea85d5db8548b314b","unresolved":false,"context_lines":[{"line_number":758,"context_line":"            num_instances \u003d self.properties[self.DESIRED_CAPACITY]"},{"line_number":759,"context_line":"        else:"},{"line_number":760,"context_line":"            num_instances \u003d self.properties[self.MIN_SIZE]"},{"line_number":761,"context_line":"        return self._create_template(num_instances)"},{"line_number":762,"context_line":""},{"line_number":763,"context_line":""},{"line_number":764,"context_line":"class LaunchConfiguration(resource.Resource):"}],"source_content_type":"text/x-python","patch_set":2,"id":"7adec928_a41d9f68","line":761,"updated":"2014-05-23 14:40:18.000000000","message":"It seems to me that this should be returning a template with the _actual_ current number of instances, instead of the minimum. \n\nIn other words, I think you can just use num_instances \u003d len(self.get_instances()).\n\nThis would also allow you to share the implementation between InstanceGroup and AutoScalingGroup (and *its* subclass, AutoScalingResourceGroup!) without overriding it.","commit_id":"b8dc63378bd378d78639f94655b659f60df45fd0"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"c1342951f8b6308a9c7a74cf49478e8b167f4136","unresolved":false,"context_lines":[{"line_number":758,"context_line":"            num_instances \u003d self.properties[self.DESIRED_CAPACITY]"},{"line_number":759,"context_line":"        else:"},{"line_number":760,"context_line":"            num_instances \u003d self.properties[self.MIN_SIZE]"},{"line_number":761,"context_line":"        return self._create_template(num_instances)"},{"line_number":762,"context_line":""},{"line_number":763,"context_line":""},{"line_number":764,"context_line":"class LaunchConfiguration(resource.Resource):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ae8d1ca_f76cc59e","line":761,"in_reply_to":"3ae8d1ca_c8e21503","updated":"2014-05-29 08:25:38.000000000","message":"@Christopher: I meant child_template calls  _create_template after get_instances. However error happened in _create_template, so your suggestion was correct.\nPossibly my error was related with other problem (may be local). \n\nBut I still disagree with using get_instances. I have tested old and new approaches and they have one big difference:\nCurrent implementation use property values directly and num_instances always will be equal to number value (Size, Min_size or Desired_capacity). \nself.get_instances() uses self.nested() [1] which returns None during preview. So num_instances became 0. As result preview always shows zero nested resources. \n\n\n[1] https://github.com/openstack/heat/blob/master/heat/engine/resources/autoscaling.py#L207","commit_id":"b8dc63378bd378d78639f94655b659f60df45fd0"},{"author":{"_account_id":6800,"name":"Christopher Armstrong","email":"chris.armstrong@rackspace.com","username":"radix"},"change_message_id":"1a4be2e6f99c5a98564b52be49a9069974dc1762","unresolved":false,"context_lines":[{"line_number":758,"context_line":"            num_instances \u003d self.properties[self.DESIRED_CAPACITY]"},{"line_number":759,"context_line":"        else:"},{"line_number":760,"context_line":"            num_instances \u003d self.properties[self.MIN_SIZE]"},{"line_number":761,"context_line":"        return self._create_template(num_instances)"},{"line_number":762,"context_line":""},{"line_number":763,"context_line":""},{"line_number":764,"context_line":"class LaunchConfiguration(resource.Resource):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ae8d1ca_303aa236","line":761,"in_reply_to":"3ae8d1ca_f76cc59e","updated":"2014-05-29 17:39:28.000000000","message":"Okay, I understand now.\n\nI think I was also confused initially because it seemed this implementation wouldn\u0027t work for OS::Heat::AutoScalingGroup (AutoScalingResourceGroup), but now that I look again I don\u0027t see how it would be a problem.","commit_id":"b8dc63378bd378d78639f94655b659f60df45fd0"},{"author":{"_account_id":6800,"name":"Christopher Armstrong","email":"chris.armstrong@rackspace.com","username":"radix"},"change_message_id":"f0e1d1bbd315bd8f4b1844d44f117d74b7720e9b","unresolved":false,"context_lines":[{"line_number":758,"context_line":"            num_instances \u003d self.properties[self.DESIRED_CAPACITY]"},{"line_number":759,"context_line":"        else:"},{"line_number":760,"context_line":"            num_instances \u003d self.properties[self.MIN_SIZE]"},{"line_number":761,"context_line":"        return self._create_template(num_instances)"},{"line_number":762,"context_line":""},{"line_number":763,"context_line":""},{"line_number":764,"context_line":"class LaunchConfiguration(resource.Resource):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ae8d1ca_c8e21503","line":761,"in_reply_to":"5adbc538_5f2cfd4a","updated":"2014-05-27 14:47:35.000000000","message":"I\u0027m confused. You said get_instances calls _create_template, but I don\u0027t see anything at all like that.","commit_id":"b8dc63378bd378d78639f94655b659f60df45fd0"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"ad0ef187907e9c6e3ce42935c5edd560f3b873d5","unresolved":false,"context_lines":[{"line_number":758,"context_line":"            num_instances \u003d self.properties[self.DESIRED_CAPACITY]"},{"line_number":759,"context_line":"        else:"},{"line_number":760,"context_line":"            num_instances \u003d self.properties[self.MIN_SIZE]"},{"line_number":761,"context_line":"        return self._create_template(num_instances)"},{"line_number":762,"context_line":""},{"line_number":763,"context_line":""},{"line_number":764,"context_line":"class LaunchConfiguration(resource.Resource):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5adbc538_5f2cfd4a","line":761,"in_reply_to":"7adec928_a41d9f68","updated":"2014-05-26 09:33:28.000000000","message":"@Christopher: sounds good, but I prefer to stay current implementation.\nBecause I have tried to apply your approach, but got some other problems.\n\nAutoScaling template (presented in bug description) contains reference on LaunchConfig resource, and we could not correct to resolve this reference. So we have something like this:\n\n1. self.get_instances calls  self._create_template(num_instances)\n2. self._create_template calls self._get_instance_definition\n3. where self.properties[self.LAUNCH_CONFIGURATION_NAME] returns None, because \"Ref\" return physical_resource_name, that does not exist (because we do preview)\n4. then self.stack.resource_by_refid(conf_name) - return first similar resource (it will be CfnUser, because we iterate by resource and find resource with Ref equal None).\n5. and then we get fail, because this template for this resource does not have Property section.\n\nSo anyway suggested algorithm is incorrect, because we have not valid references.\n\nFrom other side, child_template is used only for preview process and should demonstrate how much resources will be created when we create stack.\nAccording to these ideas, we could use property values.","commit_id":"b8dc63378bd378d78639f94655b659f60df45fd0"},{"author":{"_account_id":7385,"name":"Thomas Herve","email":"therve@redhat.com","username":"therve"},"change_message_id":"9f17e087e1b40f19828dae2579745101c661249d","unresolved":false,"context_lines":[{"line_number":753,"context_line":"        else:"},{"line_number":754,"context_line":"            num_instances \u003d self.properties[self.MIN_SIZE]"},{"line_number":755,"context_line":"        return self._create_template(num_instances)"},{"line_number":756,"context_line":""},{"line_number":757,"context_line":""},{"line_number":758,"context_line":"class LaunchConfiguration(resource.Resource):"},{"line_number":759,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1ae5cdf2_a4f2966c","line":756,"updated":"2014-06-20 09:39:45.000000000","message":"I think there is a good opportunity here to reuse this code in handle_create to reduce duplication.","commit_id":"05a6462e352aebe498ad7ff0652e2eef32bc911f"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"dd56609b52985224d2c5fae86fe849251e1a5667","unresolved":false,"context_lines":[{"line_number":753,"context_line":"        else:"},{"line_number":754,"context_line":"            num_instances \u003d self.properties[self.MIN_SIZE]"},{"line_number":755,"context_line":"        return self._create_template(num_instances)"},{"line_number":756,"context_line":""},{"line_number":757,"context_line":""},{"line_number":758,"context_line":"class LaunchConfiguration(resource.Resource):"},{"line_number":759,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1ae5cdf2_e1ed6b26","line":756,"in_reply_to":"1ae5cdf2_a4f2966c","updated":"2014-06-20 11:47:39.000000000","message":"Done","commit_id":"05a6462e352aebe498ad7ff0652e2eef32bc911f"}]}
