)]}'
{"heat/objects/watch_data.py":[{"author":{"_account_id":8289,"name":"huangtianhua","email":"tiantian223@163.com","username":"huangtianhua"},"change_message_id":"696b6776e10426927f51db63bef1f5a30b71fd76","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    @staticmethod"},{"line_number":38,"context_line":"    def _from_db_object(context, rule, db_data):"},{"line_number":39,"context_line":"        from heat.objects import watch_rule"},{"line_number":40,"context_line":"        for field in rule.fields:"},{"line_number":41,"context_line":"            if field \u003d\u003d \u0027watch_rule\u0027:"},{"line_number":42,"context_line":"                rule[field] \u003d watch_rule.WatchRule.get_by_id("}],"source_content_type":"text/x-python","patch_set":5,"id":"9a80dd14_5d2649cf","line":39,"updated":"2015-03-13 03:23:44.000000000","message":"move to upper","commit_id":"a46357a3cf40b3431578dd8aebb99039d2a0bfb7"},{"author":{"_account_id":14250,"name":"Grzegorz Grasza","email":"xek@redhat.com","username":"xek"},"change_message_id":"372485001f5ad5be2765e6174445ab68dcacda4e","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    @staticmethod"},{"line_number":38,"context_line":"    def _from_db_object(context, rule, db_data):"},{"line_number":39,"context_line":"        from heat.objects import watch_rule"},{"line_number":40,"context_line":"        for field in rule.fields:"},{"line_number":41,"context_line":"            if field \u003d\u003d \u0027watch_rule\u0027:"},{"line_number":42,"context_line":"                rule[field] \u003d watch_rule.WatchRule.get_by_id("}],"source_content_type":"text/x-python","patch_set":5,"id":"9a80dd14_a1db9b7a","line":39,"in_reply_to":"9a80dd14_5d2649cf","updated":"2015-03-13 08:22:37.000000000","message":"this would cause an import error as watch_rule imports watch_data","commit_id":"a46357a3cf40b3431578dd8aebb99039d2a0bfb7"},{"author":{"_account_id":14131,"name":"shaohef","email":"shaohe.feng@intel.com","username":"shaohefeng"},"change_message_id":"0796aae44fa33d66f2623e92f6ad23d414abfd6c","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    @staticmethod"},{"line_number":38,"context_line":"    def _from_db_object(context, rule, db_data):"},{"line_number":39,"context_line":"        from heat.objects import watch_rule"},{"line_number":40,"context_line":"        for field in rule.fields:"},{"line_number":41,"context_line":"            if field \u003d\u003d \u0027watch_rule\u0027:"},{"line_number":42,"context_line":"                rule[field] \u003d watch_rule.WatchRule.get_by_id("}],"source_content_type":"text/x-python","patch_set":5,"id":"9a80dd14_cb8dd332","line":39,"in_reply_to":"9a80dd14_a1db9b7a","updated":"2015-03-15 08:45:25.000000000","message":"yes.  I have looked into this problem. \n\n Maybe TODO here is good, we will improve it later. and explain the reason.  \n\n see more detail. \n https://review.openstack.org/#/c/146841/17/heat/objects/stack.py\n\n  Nova uses a register_all mechanism.\n\n It has called register_all to import all objects module when every nova service start.\n\n detail\n  $ cat nova/objects/__init__.py\n  def register_all():\n      # NOTE(danms): You must make sure your object gets imported in this\n      # function in order for it to be registered by services that may\n      # need to receive it via RPC.\n      __import__(\u0027nova.objects.agent\u0027)\n      __import__(\u0027nova.objects.aggregate\u0027)\n      __import__(\u0027nova.objects.bandwidth_usage\u0027)\n      __import__(\u0027nova.objects.block_device\u0027)\n      __import__(\u0027nova.objects.compute_node\u0027)\n      __import__(\u0027nova.objects.dns_domain\u0027)\n      ...\n\n  $ git grep register_all\n  nova/cmd/all.py:    objects.register_all()\n  nova/cmd/api.py:    objects.register_all()\n  nova/cmd/api_ec2.py:    objects.register_all()\n  nova/cmd/api_metadata.py:    objects.register_all()\n  nova/cmd/api_os_compute.py:    objects.register_all()\n  nova/cmd/cells.py:    objects.register_all()\n  nova/cmd/compute.py:    objects.register_all()\n  nova/cmd/conductor.py:    objects.register_all()\n  nova/cmd/consoleauth.py:    objects.register_all()\n  nova/cmd/dhcpbridge.py:    objects.register_all()\n  nova/cmd/manage.py:    objects.register_all()\n  nova/cmd/network.py:    objects.register_all()\n  nova/cmd/scheduler.py:    objects.register_all()\n  nova/objects/__init__.py:def register_all():\n  nova/test.py:objects.register_all()","commit_id":"a46357a3cf40b3431578dd8aebb99039d2a0bfb7"},{"author":{"_account_id":14131,"name":"shaohef","email":"shaohe.feng@intel.com","username":"shaohefeng"},"change_message_id":"310b4d2b29349bacd27751343febb22a179ed875","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        for field in rule.fields:"},{"line_number":41,"context_line":"            if field \u003d\u003d \u0027watch_rule\u0027:"},{"line_number":42,"context_line":"                rule[field] \u003d watch_rule.WatchRule.get_by_id("},{"line_number":43,"context_line":"                    context, db_data[\u0027watch_rule_id\u0027])"},{"line_number":44,"context_line":"            else:"},{"line_number":45,"context_line":"                rule[field] \u003d db_data[field]"},{"line_number":46,"context_line":"        rule._context \u003d context"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a80dd14_db7d976e","line":43,"updated":"2015-03-16 03:20:11.000000000","message":"This will case db session error. \n\n you do not need to get WatchRule again. \n The db model can get the related WatchRule by foreign key.\n\n you just:\n  watch_rule.WatchRule._from_db_object(context, watch_rule.WatchRule() , db_data[\u0027watch_rule\u0027])","commit_id":"a46357a3cf40b3431578dd8aebb99039d2a0bfb7"}]}
