)]}'
{"heat/engine/resources/neutron/net.py":[{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"521b3b0710e1be1abd523bf3b3ad866903d3f81d","unresolved":false,"context_lines":[{"line_number":144,"context_line":"            raise ex"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    def _replace_agents(self, agent_ids\u003dNone):"},{"line_number":147,"context_line":"        ret \u003d self.neutron().list_dhcp_agent_hosting_networks("},{"line_number":148,"context_line":"            self.resource_id)"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"        cur_agent_ids \u003d []"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2FGd8%3D","line":147,"updated":"2014-03-20 09:04:59.000000000","message":"why not use self.properties.get(self.AGENT_IDS) here and save one API call?","commit_id":"648799bbd16675dd0cf46966ff7b829d56416b5e"},{"author":{"_account_id":8844,"name":"Mitsuru Kanabuchi","email":"kanabuchi.mitsuru@po.ntts.co.jp","username":"kanabuchi"},"change_message_id":"87f438a8080752214e25e23754d9e7cf93d6ecd0","unresolved":false,"context_lines":[{"line_number":144,"context_line":"            raise ex"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    def _replace_agents(self, agent_ids\u003dNone):"},{"line_number":147,"context_line":"        ret \u003d self.neutron().list_dhcp_agent_hosting_networks("},{"line_number":148,"context_line":"            self.resource_id)"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"        cur_agent_ids \u003d []"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2FFeI%3D","line":147,"in_reply_to":"AAAAWH%2F%2FGd8%3D","updated":"2014-03-20 11:40:02.000000000","message":"It has reason. Neutron assign DHCPAgent automatically when port created.\nIf stack-update occur after port created, Heat have to delete DHCPAgent that haven\u0027t managed by Heat.\nlist_dhcp_agent_hosting_networks is necessary for getting unmanaged one.","commit_id":"648799bbd16675dd0cf46966ff7b829d56416b5e"},{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"521b3b0710e1be1abd523bf3b3ad866903d3f81d","unresolved":false,"context_lines":[{"line_number":147,"context_line":"        ret \u003d self.neutron().list_dhcp_agent_hosting_networks("},{"line_number":148,"context_line":"            self.resource_id)"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"        cur_agent_ids \u003d []"},{"line_number":151,"context_line":"        for agent in ret[\u0027agents\u0027]:"},{"line_number":152,"context_line":"            cur_agent_ids.append(agent[\u0027id\u0027])"},{"line_number":153,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2FGlc%3D","line":150,"updated":"2014-03-20 09:04:59.000000000","message":"this can be done with list comprehension:\n\ncur_agents_id \u003d [agent[\u0027id\u0027] for agent in ret[\u0027agents\u0027]]\n\nor make it a set (see my next comment):\n\ncur_agents_id \u003d set(agent[\u0027id\u0027] for agent in ret[\u0027agents\u0027])\n\n(can\u0027t use set comprehension here as they are absent in Py2.6)","commit_id":"648799bbd16675dd0cf46966ff7b829d56416b5e"},{"author":{"_account_id":8844,"name":"Mitsuru Kanabuchi","email":"kanabuchi.mitsuru@po.ntts.co.jp","username":"kanabuchi"},"change_message_id":"87f438a8080752214e25e23754d9e7cf93d6ecd0","unresolved":false,"context_lines":[{"line_number":147,"context_line":"        ret \u003d self.neutron().list_dhcp_agent_hosting_networks("},{"line_number":148,"context_line":"            self.resource_id)"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"        cur_agent_ids \u003d []"},{"line_number":151,"context_line":"        for agent in ret[\u0027agents\u0027]:"},{"line_number":152,"context_line":"            cur_agent_ids.append(agent[\u0027id\u0027])"},{"line_number":153,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2FFk4%3D","line":150,"in_reply_to":"AAAAWH%2F%2FGlc%3D","updated":"2014-03-20 11:40:02.000000000","message":"Done. I used list comprehension for gate-heat-python26.","commit_id":"648799bbd16675dd0cf46966ff7b829d56416b5e"},{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"521b3b0710e1be1abd523bf3b3ad866903d3f81d","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        for agent in ret[\u0027agents\u0027]:"},{"line_number":152,"context_line":"            cur_agent_ids.append(agent[\u0027id\u0027])"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        for agent_id in agent_ids:"},{"line_number":155,"context_line":"            if agent_id not in cur_agent_ids:"},{"line_number":156,"context_line":"                try:"},{"line_number":157,"context_line":"                    self.neutron().add_network_to_dhcp_agent("}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2FGhk%3D","line":154,"updated":"2014-03-20 09:04:59.000000000","message":"following two loops could use sets:\n\nold \u003d set(current_agents_id)\n\nnew \u003d set(agent_ids)\n\nfor agent_id in old - new:\n  remove_network()\nfor agent_id in new - old:\n  add_network()","commit_id":"648799bbd16675dd0cf46966ff7b829d56416b5e"},{"author":{"_account_id":8844,"name":"Mitsuru Kanabuchi","email":"kanabuchi.mitsuru@po.ntts.co.jp","username":"kanabuchi"},"change_message_id":"87f438a8080752214e25e23754d9e7cf93d6ecd0","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        for agent in ret[\u0027agents\u0027]:"},{"line_number":152,"context_line":"            cur_agent_ids.append(agent[\u0027id\u0027])"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        for agent_id in agent_ids:"},{"line_number":155,"context_line":"            if agent_id not in cur_agent_ids:"},{"line_number":156,"context_line":"                try:"},{"line_number":157,"context_line":"                    self.neutron().add_network_to_dhcp_agent("}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2FFk0%3D","line":154,"in_reply_to":"AAAAWH%2F%2FGhk%3D","updated":"2014-03-20 11:40:02.000000000","message":"Done. It\u0027s really smart. Thanks.","commit_id":"648799bbd16675dd0cf46966ff7b829d56416b5e"},{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"e098ee695df13a1471e90f46489afd6dadccdf63","unresolved":false,"context_lines":[{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    def _replace_agents(self, agent_ids\u003dNone):"},{"line_number":147,"context_line":"        ret \u003d self.neutron().list_dhcp_agent_hosting_networks("},{"line_number":148,"context_line":"            self.resource_id)"},{"line_number":149,"context_line":"        cur_agent_ids \u003d [agent[\u0027id\u0027] for agent in ret[\u0027agents\u0027]]"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        old \u003d set(cur_agent_ids)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F%2FFgs%3D","line":148,"updated":"2014-03-20 11:37:50.000000000","message":"I still do not see the point of making this API call. AFAIK for now heat is presumed to operate as if only heat modifies resources, and if something (not heat) changed the resources in the cloud that is another story, which is addressed by stack convergence feature blueprints.","commit_id":"18b6dc9f1c4d86b1667eb8abe5ea71d2af888391"},{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"977115e084f5b452d5745c7dce313723f449e91a","unresolved":false,"context_lines":[{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    def _replace_agents(self, agent_ids\u003dNone):"},{"line_number":147,"context_line":"        ret \u003d self.neutron().list_dhcp_agent_hosting_networks("},{"line_number":148,"context_line":"            self.resource_id)"},{"line_number":149,"context_line":"        cur_agent_ids \u003d [agent[\u0027id\u0027] for agent in ret[\u0027agents\u0027]]"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        old \u003d set(cur_agent_ids)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F%2FFcU%3D","line":148,"in_reply_to":"AAAAWH%2F%2FFgs%3D","updated":"2014-03-20 11:41:55.000000000","message":"thanks for clarifying this, removing my -1","commit_id":"18b6dc9f1c4d86b1667eb8abe5ea71d2af888391"},{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"e098ee695df13a1471e90f46489afd6dadccdf63","unresolved":false,"context_lines":[{"line_number":147,"context_line":"        ret \u003d self.neutron().list_dhcp_agent_hosting_networks("},{"line_number":148,"context_line":"            self.resource_id)"},{"line_number":149,"context_line":"        cur_agent_ids \u003d [agent[\u0027id\u0027] for agent in ret[\u0027agents\u0027]]"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        old \u003d set(cur_agent_ids)"},{"line_number":152,"context_line":"        new \u003d set(agent_ids)"},{"line_number":153,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F%2FFf0%3D","line":150,"updated":"2014-03-20 11:37:50.000000000","message":"NBD but these two lines (149+151) could be combined into one old \u003d set([...])","commit_id":"18b6dc9f1c4d86b1667eb8abe5ea71d2af888391"},{"author":{"_account_id":8844,"name":"Mitsuru Kanabuchi","email":"kanabuchi.mitsuru@po.ntts.co.jp","username":"kanabuchi"},"change_message_id":"21b997a2261a9ce833859bd4c76fd3107366da41","unresolved":false,"context_lines":[{"line_number":147,"context_line":"        ret \u003d self.neutron().list_dhcp_agent_hosting_networks("},{"line_number":148,"context_line":"            self.resource_id)"},{"line_number":149,"context_line":"        cur_agent_ids \u003d [agent[\u0027id\u0027] for agent in ret[\u0027agents\u0027]]"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        old \u003d set(cur_agent_ids)"},{"line_number":152,"context_line":"        new \u003d set(agent_ids)"},{"line_number":153,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F%2FFPU%3D","line":150,"in_reply_to":"AAAAWH%2F%2FFZk%3D","updated":"2014-03-20 12:09:02.000000000","message":"It\u0027s done. Thank you for re-advise.","commit_id":"18b6dc9f1c4d86b1667eb8abe5ea71d2af888391"},{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"e7037b10041b9707a46acf95f705c7a53145fd4e","unresolved":false,"context_lines":[{"line_number":147,"context_line":"        ret \u003d self.neutron().list_dhcp_agent_hosting_networks("},{"line_number":148,"context_line":"            self.resource_id)"},{"line_number":149,"context_line":"        cur_agent_ids \u003d [agent[\u0027id\u0027] for agent in ret[\u0027agents\u0027]]"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        old \u003d set(cur_agent_ids)"},{"line_number":152,"context_line":"        new \u003d set(agent_ids)"},{"line_number":153,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F%2FFZk%3D","line":150,"in_reply_to":"AAAAWH%2F%2FFf0%3D","updated":"2014-03-20 11:47:08.000000000","message":"you can still use set([..]) in Py2.6, what you can not use is {item for item in something}, which is a set comprehension syntax backported form Py3 to Py2.7 only.","commit_id":"18b6dc9f1c4d86b1667eb8abe5ea71d2af888391"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"91f2f493fec718da6485a727d160656dd077542c","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        AGENT_IDS,"},{"line_number":31,"context_line":"    ) \u003d ("},{"line_number":32,"context_line":"        \u0027name\u0027, \u0027value_specs\u0027, \u0027admin_state_up\u0027, \u0027tenant_id\u0027, \u0027shared\u0027,"},{"line_number":33,"context_line":"        \u0027agent_ids\u0027,"},{"line_number":34,"context_line":"    )"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    properties_schema \u003d {"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2FCeI%3D","line":33,"updated":"2014-03-20 18:31:20.000000000","message":"Is a DHCP Agent the only type of agent that could conceivably be associated with the Network? Or should this name be something like \u0027dhcp_agent_ids\u0027?\n\nThe fact that the Neutron client calls are of the form add_network_to_dhcp_agent() suggests that \u0027dhcp\u0027 should be in the name.","commit_id":"9ce8bedc0223e0b6d107e2ff31bda242e6602f80"},{"author":{"_account_id":8844,"name":"Mitsuru Kanabuchi","email":"kanabuchi.mitsuru@po.ntts.co.jp","username":"kanabuchi"},"change_message_id":"36168c4c3d86d923d1e21b476add45f36d3b7697","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        AGENT_IDS,"},{"line_number":31,"context_line":"    ) \u003d ("},{"line_number":32,"context_line":"        \u0027name\u0027, \u0027value_specs\u0027, \u0027admin_state_up\u0027, \u0027tenant_id\u0027, \u0027shared\u0027,"},{"line_number":33,"context_line":"        \u0027agent_ids\u0027,"},{"line_number":34,"context_line":"    )"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    properties_schema \u003d {"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2By7o%3D","line":33,"in_reply_to":"AAAAWH%2F%2B0C0%3D","updated":"2014-03-24 09:45:52.000000000","message":"I proposed the bug report that aims to change router\u0027s \"agent_id\" to \"l3_agent_id\":\n\n  https://bugs.launchpad.net/heat/+bug/1296608","commit_id":"9ce8bedc0223e0b6d107e2ff31bda242e6602f80"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"27cbba09bd719110e29e3e9ab6f669a11a4b1681","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        AGENT_IDS,"},{"line_number":31,"context_line":"    ) \u003d ("},{"line_number":32,"context_line":"        \u0027name\u0027, \u0027value_specs\u0027, \u0027admin_state_up\u0027, \u0027tenant_id\u0027, \u0027shared\u0027,"},{"line_number":33,"context_line":"        \u0027agent_ids\u0027,"},{"line_number":34,"context_line":"    )"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    properties_schema \u003d {"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2BuPg%3D","line":33,"in_reply_to":"AAAAWH%2F%2By7o%3D","updated":"2014-03-24 20:21:31.000000000","message":"+1, thanks.","commit_id":"9ce8bedc0223e0b6d107e2ff31bda242e6602f80"},{"author":{"_account_id":8844,"name":"Mitsuru Kanabuchi","email":"kanabuchi.mitsuru@po.ntts.co.jp","username":"kanabuchi"},"change_message_id":"b1247c64f12bd8519faba82eec82a6889c0608a3","unresolved":false,"context_lines":[{"line_number":30,"context_line":"        AGENT_IDS,"},{"line_number":31,"context_line":"    ) \u003d ("},{"line_number":32,"context_line":"        \u0027name\u0027, \u0027value_specs\u0027, \u0027admin_state_up\u0027, \u0027tenant_id\u0027, \u0027shared\u0027,"},{"line_number":33,"context_line":"        \u0027agent_ids\u0027,"},{"line_number":34,"context_line":"    )"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    properties_schema \u003d {"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B0C0%3D","line":33,"in_reply_to":"AAAAWH%2F%2FCeI%3D","updated":"2014-03-24 05:13:12.000000000","message":"It\u0027s done. I think, your comment indicates that router\u0027s \"agent_id\" should change to \"l3_agent_id\". If it\u0027s right, I\u0027ll register a bug report and change it.","commit_id":"9ce8bedc0223e0b6d107e2ff31bda242e6602f80"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"ffd27b52722a78bbc1dc93b40d9bd2b806c3a510","unresolved":false,"context_lines":[{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        if self.AGENT_IDS in prop_diff:"},{"line_number":128,"context_line":"            if agent_ids is not None:"},{"line_number":129,"context_line":"                self._replace_agents(agent_ids)"},{"line_number":130,"context_line":"            del prop_diff[self.AGENT_IDS]"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"        if len(prop_diff) \u003e 0:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2FBNE%3D","line":129,"updated":"2014-03-20 21:51:30.000000000","message":"If agent_ids is None, but we have new agent_ids in prop_diff, should we add these agents to network. As I understand currently you only delete these values without replacing. right?","commit_id":"9ce8bedc0223e0b6d107e2ff31bda242e6602f80"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"91ea14d644e0e77f571b94e1fe0d96781e491f85","unresolved":false,"context_lines":[{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        if self.AGENT_IDS in prop_diff:"},{"line_number":128,"context_line":"            if agent_ids is not None:"},{"line_number":129,"context_line":"                self._replace_agents(agent_ids)"},{"line_number":130,"context_line":"            del prop_diff[self.AGENT_IDS]"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"        if len(prop_diff) \u003e 0:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2Bz18%3D","line":129,"in_reply_to":"AAAAWH%2F%2B0Cw%3D","updated":"2014-03-24 06:12:00.000000000","message":"Oh. yes. I forgot look in prepare_update_properties. (it\u0027s really impossible)","commit_id":"9ce8bedc0223e0b6d107e2ff31bda242e6602f80"},{"author":{"_account_id":8844,"name":"Mitsuru Kanabuchi","email":"kanabuchi.mitsuru@po.ntts.co.jp","username":"kanabuchi"},"change_message_id":"b1247c64f12bd8519faba82eec82a6889c0608a3","unresolved":false,"context_lines":[{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        if self.AGENT_IDS in prop_diff:"},{"line_number":128,"context_line":"            if agent_ids is not None:"},{"line_number":129,"context_line":"                self._replace_agents(agent_ids)"},{"line_number":130,"context_line":"            del prop_diff[self.AGENT_IDS]"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"        if len(prop_diff) \u003e 0:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B0Cw%3D","line":129,"in_reply_to":"AAAAWH%2F%2FBNE%3D","updated":"2014-03-24 05:13:12.000000000","message":"In my understanding, it\u0027s never happen \"agent_ids\u003dNone and new agent_ids in prop_diff\" at same time. In case of new DHCP Agent in prop_diff, props also has same DHCP Agent. Please tell me if my understanding isn\u0027t right.","commit_id":"9ce8bedc0223e0b6d107e2ff31bda242e6602f80"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"ffd27b52722a78bbc1dc93b40d9bd2b806c3a510","unresolved":false,"context_lines":[{"line_number":143,"context_line":"                isinstance(ex, neutron_exp.NetworkNotFoundClient)):"},{"line_number":144,"context_line":"            raise ex"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    def _replace_agents(self, agent_ids\u003dNone):"},{"line_number":147,"context_line":"        ret \u003d self.neutron().list_dhcp_agent_hosting_networks("},{"line_number":148,"context_line":"            self.resource_id)"},{"line_number":149,"context_line":"        old \u003d set([agent[\u0027id\u0027] for agent in ret[\u0027agents\u0027]])"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2FBQI%3D","line":146,"updated":"2014-03-20 21:51:30.000000000","message":"Why do replace_agents contain default parameter agent_ids?\nIn all places where this function are used default value is unnecessary. Also it may be potential  error when you try to do set(None)  for default value","commit_id":"9ce8bedc0223e0b6d107e2ff31bda242e6602f80"},{"author":{"_account_id":8844,"name":"Mitsuru Kanabuchi","email":"kanabuchi.mitsuru@po.ntts.co.jp","username":"kanabuchi"},"change_message_id":"b1247c64f12bd8519faba82eec82a6889c0608a3","unresolved":false,"context_lines":[{"line_number":143,"context_line":"                isinstance(ex, neutron_exp.NetworkNotFoundClient)):"},{"line_number":144,"context_line":"            raise ex"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    def _replace_agents(self, agent_ids\u003dNone):"},{"line_number":147,"context_line":"        ret \u003d self.neutron().list_dhcp_agent_hosting_networks("},{"line_number":148,"context_line":"            self.resource_id)"},{"line_number":149,"context_line":"        old \u003d set([agent[\u0027id\u0027] for agent in ret[\u0027agents\u0027]])"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B0Ck%3D","line":146,"in_reply_to":"AAAAWH%2F%2FBQI%3D","updated":"2014-03-24 05:13:12.000000000","message":"Your comment is right. \"agent_ids\u003dNone\" isn\u0027t necessary, so I removed default value.","commit_id":"9ce8bedc0223e0b6d107e2ff31bda242e6602f80"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"ffd27b52722a78bbc1dc93b40d9bd2b806c3a510","unresolved":false,"context_lines":[{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    def _replace_agents(self, agent_ids\u003dNone):"},{"line_number":147,"context_line":"        ret \u003d self.neutron().list_dhcp_agent_hosting_networks("},{"line_number":148,"context_line":"            self.resource_id)"},{"line_number":149,"context_line":"        old \u003d set([agent[\u0027id\u0027] for agent in ret[\u0027agents\u0027]])"},{"line_number":150,"context_line":"        new \u003d set(agent_ids)"},{"line_number":151,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2FBOA%3D","line":148,"updated":"2014-03-20 21:51:30.000000000","message":"Can be situation when ret will be None?","commit_id":"9ce8bedc0223e0b6d107e2ff31bda242e6602f80"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"91ea14d644e0e77f571b94e1fe0d96781e491f85","unresolved":false,"context_lines":[{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    def _replace_agents(self, agent_ids\u003dNone):"},{"line_number":147,"context_line":"        ret \u003d self.neutron().list_dhcp_agent_hosting_networks("},{"line_number":148,"context_line":"            self.resource_id)"},{"line_number":149,"context_line":"        old \u003d set([agent[\u0027id\u0027] for agent in ret[\u0027agents\u0027]])"},{"line_number":150,"context_line":"        new \u003d set(agent_ids)"},{"line_number":151,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2Bz8c%3D","line":148,"in_reply_to":"AAAAWH%2F%2B0Cg%3D","updated":"2014-03-24 06:12:00.000000000","message":"gotcha, I agree that in this case additional check is unnecessary.","commit_id":"9ce8bedc0223e0b6d107e2ff31bda242e6602f80"},{"author":{"_account_id":8844,"name":"Mitsuru Kanabuchi","email":"kanabuchi.mitsuru@po.ntts.co.jp","username":"kanabuchi"},"change_message_id":"b1247c64f12bd8519faba82eec82a6889c0608a3","unresolved":false,"context_lines":[{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    def _replace_agents(self, agent_ids\u003dNone):"},{"line_number":147,"context_line":"        ret \u003d self.neutron().list_dhcp_agent_hosting_networks("},{"line_number":148,"context_line":"            self.resource_id)"},{"line_number":149,"context_line":"        old \u003d set([agent[\u0027id\u0027] for agent in ret[\u0027agents\u0027]])"},{"line_number":150,"context_line":"        new \u003d set(agent_ids)"},{"line_number":151,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B0Cg%3D","line":148,"in_reply_to":"AAAAWH%2F%2FBOA%3D","updated":"2014-03-24 05:13:12.000000000","message":"A empty list \"{agents:[]}\" would return by the Neutron client when a network have no DHCP Agent. I think, the None guard isn\u0027t necessary here.","commit_id":"9ce8bedc0223e0b6d107e2ff31bda242e6602f80"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"db0cb13fc01977d9b77e82746cd919efd047cbf4","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    def handle_update(self, json_snippet, tmpl_diff, prop_diff):"},{"line_number":123,"context_line":"        props \u003d self.prepare_update_properties(json_snippet)"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        dhcp_agent_ids \u003d props.pop(self.DHCP_AGENT_IDS, None)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        if self.DHCP_AGENT_IDS in prop_diff:"},{"line_number":128,"context_line":"            if dhcp_agent_ids is not None:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAWH%2F%2Bz0I%3D","line":125,"updated":"2014-03-24 06:14:24.000000000","message":"So one optimization is happen in this case, I guess: \nyou would remove agent_ids from props only when \"self.AGENT_IDS in prop_diff\", and in this you could not set default value None for pop method.\n\nif self.DHCP_AGENT_IDS in prop_diff:\n    dhcp_agent_ids \u003d props.pop(self.DHCP_AGENT_IDS)\n    ...","commit_id":"988b71bd5a93050b4dc8b5f7fba6dbfa3e14c254"},{"author":{"_account_id":8844,"name":"Mitsuru Kanabuchi","email":"kanabuchi.mitsuru@po.ntts.co.jp","username":"kanabuchi"},"change_message_id":"206f4e46cb5b2885784d45e5906b258c8e1ac188","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    def handle_update(self, json_snippet, tmpl_diff, prop_diff):"},{"line_number":123,"context_line":"        props \u003d self.prepare_update_properties(json_snippet)"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        dhcp_agent_ids \u003d props.pop(self.DHCP_AGENT_IDS, None)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        if self.DHCP_AGENT_IDS in prop_diff:"},{"line_number":128,"context_line":"            if dhcp_agent_ids is not None:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAWH%2F%2BzfM%3D","line":125,"in_reply_to":"AAAAWH%2F%2Bz0I%3D","updated":"2014-03-24 07:46:01.000000000","message":"I think, currently code would appropriate.\nIn case of the dhcp_agent_ids haven\u0027t updated when stack-update,\n\n  * The props has have the self.DHCP_AGENT_IDS\n  * The prop_diff hasn\u0027t have the self.DHCP_AGENT_IDS because the property hasn\u0027t changed\n\nIn this case, we shouldn\u0027t modify the dhcp_agents but we should remove the self.DHCP_AGENT_IDS from the props for avoiding a error at update_network.\nProbably, the optimization code would make error in this case.","commit_id":"988b71bd5a93050b4dc8b5f7fba6dbfa3e14c254"},{"author":{"_account_id":6577,"name":"Sergey Kraynev","email":"sergejyit@gmail.com","username":"skraynev"},"change_message_id":"a8223c51dda1ef625eee3e48c45d25dcb8a62ad3","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    def handle_update(self, json_snippet, tmpl_diff, prop_diff):"},{"line_number":123,"context_line":"        props \u003d self.prepare_update_properties(json_snippet)"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        dhcp_agent_ids \u003d props.pop(self.DHCP_AGENT_IDS, None)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        if self.DHCP_AGENT_IDS in prop_diff:"},{"line_number":128,"context_line":"            if dhcp_agent_ids is not None:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAWH%2F%2BzUU%3D","line":125,"in_reply_to":"AAAAWH%2F%2BzfM%3D","updated":"2014-03-24 08:32:04.000000000","message":"Good catch. your truth :) I have not thought about it. thanks for clarification.","commit_id":"988b71bd5a93050b4dc8b5f7fba6dbfa3e14c254"}]}
