)]}'
{"neutron/agent/linux/dhcp.py":[{"author":{"_account_id":14615,"name":"Sergey Belous","email":"belous.py@gmail.com","username":"sbelous"},"change_message_id":"6f5cbb8184b10f23580525ba48ca31fd9daf518e","unresolved":false,"context_lines":[{"line_number":1167,"context_line":""},{"line_number":1168,"context_line":"    def cleanup_stale_ports(self, network, dhcp_port):"},{"line_number":1169,"context_line":"        dev_prefix \u003d \u0027tap\u0027"},{"line_number":1170,"context_line":"        namespace \u003d \"%s%s\" % (NS_PREFIX, network.id)"},{"line_number":1171,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(namespace\u003dnamespace)"},{"line_number":1172,"context_line":"        for d in ns_ip.get_devices(exclude_loopback\u003dTrue):"},{"line_number":1173,"context_line":"            if d.name.startswith(dev_prefix):"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a26ad4f_61039d10","line":1170,"range":{"start_line":1170,"start_character":8,"end_line":1170,"end_character":17},"updated":"2015-10-27 15:59:43.000000000","message":"can we use network.namespace here?","commit_id":"60b51c0267ccc42d5143387097a89c32acf8f543"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"66328460f3923d5027bce5d6b4f3f794e3522852","unresolved":false,"context_lines":[{"line_number":1167,"context_line":""},{"line_number":1168,"context_line":"    def cleanup_stale_ports(self, network, dhcp_port):"},{"line_number":1169,"context_line":"        dev_prefix \u003d \u0027tap\u0027"},{"line_number":1170,"context_line":"        namespace \u003d \"%s%s\" % (NS_PREFIX, network.id)"},{"line_number":1171,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(namespace\u003dnamespace)"},{"line_number":1172,"context_line":"        for d in ns_ip.get_devices(exclude_loopback\u003dTrue):"},{"line_number":1173,"context_line":"            if d.name.startswith(dev_prefix):"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a26ad4f_f45e8475","line":1170,"in_reply_to":"1a26ad4f_61039d10","updated":"2015-10-27 21:32:10.000000000","message":"yes! thanks for reminder.","commit_id":"60b51c0267ccc42d5143387097a89c32acf8f543"},{"author":{"_account_id":14591,"name":"Lubosz Kosnik (diltram)","email":"lubosz.kosnik@intel.com","username":"diltram"},"change_message_id":"606c27b0ac946e8e064e400a46e7c7ae9e7f0ce7","unresolved":false,"context_lines":[{"line_number":1169,"context_line":"        dev_prefix \u003d \u0027tap\u0027"},{"line_number":1170,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(namespace\u003dnetwork.namespace)"},{"line_number":1171,"context_line":"        for d in ns_ip.get_devices(exclude_loopback\u003dTrue):"},{"line_number":1172,"context_line":"            if d.name.startswith(dev_prefix):"},{"line_number":1173,"context_line":"                # delete all ports except current active DHCP port"},{"line_number":1174,"context_line":"                if d.name[len(dev_prefix):] not in dhcp_port.id:"},{"line_number":1175,"context_line":"                    LOG.debug(\"Found stale device %s, deleting\", d.name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a26ad4f_fa8a8abe","line":1172,"updated":"2015-10-30 14:57:30.000000000","message":"Like Dariusz said you can create one liner but because of the line length limitation it will require to split it into two so in my opinion you can left it untouched","commit_id":"2a52f360fb6a213405bdd647623df1824c2a737a"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"4425ee32c8805506507917021e65b094e5840bd6","unresolved":false,"context_lines":[{"line_number":1169,"context_line":"        dev_prefix \u003d \u0027tap\u0027"},{"line_number":1170,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(namespace\u003dnetwork.namespace)"},{"line_number":1171,"context_line":"        for d in ns_ip.get_devices(exclude_loopback\u003dTrue):"},{"line_number":1172,"context_line":"            if d.name.startswith(dev_prefix):"},{"line_number":1173,"context_line":"                # delete all ports except current active DHCP port"},{"line_number":1174,"context_line":"                if d.name[len(dev_prefix):] not in dhcp_port.id:"},{"line_number":1175,"context_line":"                    LOG.debug(\"Found stale device %s, deleting\", d.name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a26ad4f_5d99661e","line":1172,"updated":"2015-10-29 12:01:31.000000000","message":"You\u0027re using a lot `d.name`. It would be worth to assign it once, and reuse it all over the places. Also, code can be written in one line:  \n\n dhcp_name \u003d d.name\n if dhcp_name.startswith(dev_prefix) and dhcp_name[len(dev_prefix):] not in dhcp_port.id:","commit_id":"2a52f360fb6a213405bdd647623df1824c2a737a"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"4811c7c0213c5ff9a8436ca2e0929a8a11990e1e","unresolved":false,"context_lines":[{"line_number":1169,"context_line":"        dev_prefix \u003d \u0027tap\u0027"},{"line_number":1170,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(namespace\u003dnetwork.namespace)"},{"line_number":1171,"context_line":"        for d in ns_ip.get_devices(exclude_loopback\u003dTrue):"},{"line_number":1172,"context_line":"            if d.name.startswith(dev_prefix):"},{"line_number":1173,"context_line":"                # delete all ports except current active DHCP port"},{"line_number":1174,"context_line":"                if d.name[len(dev_prefix):] not in dhcp_port.id:"},{"line_number":1175,"context_line":"                    LOG.debug(\"Found stale device %s, deleting\", d.name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a26ad4f_8efd863c","line":1172,"in_reply_to":"1a26ad4f_5d99661e","updated":"2015-10-29 12:17:25.000000000","message":"Using an alias instead of instance.attribute is no better, not to say it doesn\u0027t save typing here.\nwriting conditions in one line is not a goal and may decrease readability.","commit_id":"2a52f360fb6a213405bdd647623df1824c2a737a"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"ad3933bb13bdc269ba39f2b5471356931ab18414","unresolved":false,"context_lines":[{"line_number":1169,"context_line":"        dev_prefix \u003d \u0027tap\u0027"},{"line_number":1170,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(namespace\u003dnetwork.namespace)"},{"line_number":1171,"context_line":"        for d in ns_ip.get_devices(exclude_loopback\u003dTrue):"},{"line_number":1172,"context_line":"            if d.name.startswith(dev_prefix):"},{"line_number":1173,"context_line":"                # delete all ports except current active DHCP port"},{"line_number":1174,"context_line":"                if d.name[len(dev_prefix):] not in dhcp_port.id:"},{"line_number":1175,"context_line":"                    LOG.debug(\"Found stale device %s, deleting\", d.name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a26ad4f_a9739c14","line":1172,"in_reply_to":"1a26ad4f_698ca435","updated":"2015-10-29 12:42:48.000000000","message":"My mistake, sorry for that. I\u0027ve misread the method and thought that every time when you call \u0027d.name\u0027 it retrieves information from `ip netns`. So first part of my comment is invalid.","commit_id":"2a52f360fb6a213405bdd647623df1824c2a737a"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"df5f673d7412cc5934e3dda60f50d3b140af86ac","unresolved":false,"context_lines":[{"line_number":1169,"context_line":"        dev_prefix \u003d \u0027tap\u0027"},{"line_number":1170,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(namespace\u003dnetwork.namespace)"},{"line_number":1171,"context_line":"        for d in ns_ip.get_devices(exclude_loopback\u003dTrue):"},{"line_number":1172,"context_line":"            if d.name.startswith(dev_prefix):"},{"line_number":1173,"context_line":"                # delete all ports except current active DHCP port"},{"line_number":1174,"context_line":"                if d.name[len(dev_prefix):] not in dhcp_port.id:"},{"line_number":1175,"context_line":"                    LOG.debug(\"Found stale device %s, deleting\", d.name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a26ad4f_e91c3415","line":1172,"in_reply_to":"1a26ad4f_8efd863c","updated":"2015-10-29 12:31:28.000000000","message":"Using alias is not just for readability purpose, but also to avoid execution of the same command in: https://github.com/openstack/neutron/blob/master/neutron/agent/linux/ip_lib.py#L114  \n\nAbout one-liner: proposed way of writing allows to follow use-case: \"if name starts with prefix and rest of name doesn\u0027t exist in ports, do:\". I agree it needs to be wrapped, but currently these are also two lines.","commit_id":"2a52f360fb6a213405bdd647623df1824c2a737a"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"2860df7df95a3f507e98dca5fe763440a124a473","unresolved":false,"context_lines":[{"line_number":1169,"context_line":"        dev_prefix \u003d \u0027tap\u0027"},{"line_number":1170,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(namespace\u003dnetwork.namespace)"},{"line_number":1171,"context_line":"        for d in ns_ip.get_devices(exclude_loopback\u003dTrue):"},{"line_number":1172,"context_line":"            if d.name.startswith(dev_prefix):"},{"line_number":1173,"context_line":"                # delete all ports except current active DHCP port"},{"line_number":1174,"context_line":"                if d.name[len(dev_prefix):] not in dhcp_port.id:"},{"line_number":1175,"context_line":"                    LOG.debug(\"Found stale device %s, deleting\", d.name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a26ad4f_698ca435","line":1172,"in_reply_to":"1a26ad4f_e91c3415","updated":"2015-10-29 12:35:20.000000000","message":"What do you mean by \u0027execution of the same command\u0027?","commit_id":"2a52f360fb6a213405bdd647623df1824c2a737a"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"1ca36433f3039db77cb919925f3495dde459e6cc","unresolved":false,"context_lines":[{"line_number":1167,"context_line":""},{"line_number":1168,"context_line":"    def cleanup_stale_ports(self, network, dhcp_port):"},{"line_number":1169,"context_line":"        LOG.debug(\"Cleaning stale ports for network %s\", network.id)"},{"line_number":1170,"context_line":"        dev_prefix \u003d \u0027tap\u0027"},{"line_number":1171,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(namespace\u003dnetwork.namespace)"},{"line_number":1172,"context_line":"        for d in ns_ip.get_devices(exclude_loopback\u003dTrue):"},{"line_number":1173,"context_line":"            # delete all ports except current active DHCP port"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a26ad4f_0a4279ae","line":1170,"updated":"2015-11-02 10:04:25.000000000","message":"constants.TAP_DEVICE_PREFIX will be better.","commit_id":"4e2d74bd7772d2d0c0ecf8d4540c570fe0c9f297"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"3a74b5f01ae6085c2f3a618e8e91e461e97f7f7f","unresolved":false,"context_lines":[{"line_number":1167,"context_line":""},{"line_number":1168,"context_line":"    def cleanup_stale_ports(self, network, dhcp_port):"},{"line_number":1169,"context_line":"        LOG.debug(\"Cleaning stale ports for network %s\", network.id)"},{"line_number":1170,"context_line":"        dev_prefix \u003d \u0027tap\u0027"},{"line_number":1171,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(namespace\u003dnetwork.namespace)"},{"line_number":1172,"context_line":"        for d in ns_ip.get_devices(exclude_loopback\u003dTrue):"},{"line_number":1173,"context_line":"            # delete all ports except current active DHCP port"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a26ad4f_90dc6e74","line":1170,"in_reply_to":"1a26ad4f_0a4279ae","updated":"2015-11-02 16:39:43.000000000","message":"Done","commit_id":"4e2d74bd7772d2d0c0ecf8d4540c570fe0c9f297"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"0e96dd9350c3a774ae5800907c8c9ff62c3cbba5","unresolved":false,"context_lines":[{"line_number":1176,"context_line":"                    d.name[len(dev_prefix):] not in dhcp_port.id):"},{"line_number":1177,"context_line":"                    LOG.debug(\"Found stale device %s, deleting\", d.name)"},{"line_number":1178,"context_line":"                    # stale tap device"},{"line_number":1179,"context_line":"                    self.driver.unplug(d.name, namespace\u003dnetwork.namespace,"},{"line_number":1180,"context_line":"                                       prefix\u003ddev_prefix)"},{"line_number":1181,"context_line":"        except Exception:"},{"line_number":1182,"context_line":"            LOG.exception(_LE(\"Exception during stale port cleanup\"))"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa80f949_07e204d6","line":1179,"updated":"2015-11-03 12:58:12.000000000","message":"in the case that there is an exception the entire loop will not be completed. Do we want that?","commit_id":"f658deaf1646004bab84b6b6ad3d1b0da82b1202"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"d0fe73b09fd5542355f69e783cf7fd35138c050f","unresolved":false,"context_lines":[{"line_number":1176,"context_line":"                    d.name[len(dev_prefix):] not in dhcp_port.id):"},{"line_number":1177,"context_line":"                    LOG.debug(\"Found stale device %s, deleting\", d.name)"},{"line_number":1178,"context_line":"                    # stale tap device"},{"line_number":1179,"context_line":"                    self.driver.unplug(d.name, namespace\u003dnetwork.namespace,"},{"line_number":1180,"context_line":"                                       prefix\u003ddev_prefix)"},{"line_number":1181,"context_line":"        except Exception:"},{"line_number":1182,"context_line":"            LOG.exception(_LE(\"Exception during stale port cleanup\"))"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa80f949_2f77de03","line":1179,"in_reply_to":"fa80f949_07e204d6","updated":"2015-11-03 14:22:57.000000000","message":"I agree with Gary. If it\u0027s not required, we should only catch execution of unplugging instead of whole loop.","commit_id":"f658deaf1646004bab84b6b6ad3d1b0da82b1202"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"d6d0baf47cc7bf6d2db63a96b3f76daf432551eb","unresolved":false,"context_lines":[{"line_number":1176,"context_line":"                    d.name[len(dev_prefix):] not in dhcp_port.id):"},{"line_number":1177,"context_line":"                    LOG.debug(\"Found stale device %s, deleting\", d.name)"},{"line_number":1178,"context_line":"                    # stale tap device"},{"line_number":1179,"context_line":"                    self.driver.unplug(d.name, namespace\u003dnetwork.namespace,"},{"line_number":1180,"context_line":"                                       prefix\u003ddev_prefix)"},{"line_number":1181,"context_line":"        except Exception:"},{"line_number":1182,"context_line":"            LOG.exception(_LE(\"Exception during stale port cleanup\"))"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa80f949_eda9dee0","line":1179,"in_reply_to":"fa80f949_129a4115","updated":"2015-11-03 14:39:38.000000000","message":"In this case, you can get all devices before looping on this and save into var. This can be catched in try/except","commit_id":"f658deaf1646004bab84b6b6ad3d1b0da82b1202"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"ee0202f7e7c607af1047c216f3b58ee76aad8fa6","unresolved":false,"context_lines":[{"line_number":1176,"context_line":"                    d.name[len(dev_prefix):] not in dhcp_port.id):"},{"line_number":1177,"context_line":"                    LOG.debug(\"Found stale device %s, deleting\", d.name)"},{"line_number":1178,"context_line":"                    # stale tap device"},{"line_number":1179,"context_line":"                    self.driver.unplug(d.name, namespace\u003dnetwork.namespace,"},{"line_number":1180,"context_line":"                                       prefix\u003ddev_prefix)"},{"line_number":1181,"context_line":"        except Exception:"},{"line_number":1182,"context_line":"            LOG.exception(_LE(\"Exception during stale port cleanup\"))"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa80f949_129a4115","line":1179,"in_reply_to":"fa80f949_2f77de03","updated":"2015-11-03 14:33:51.000000000","message":"In fact, the exception handling was added to catch one from ns_ip.get_devices, rather than from unplug.\nThat, in turn, may happen if something happened with the namespace for whatever reason or agent doesn\u0027t have access to the namespace.","commit_id":"f658deaf1646004bab84b6b6ad3d1b0da82b1202"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"1a286f6bdbd94f580aed197efa8b1f55b97629e3","unresolved":false,"context_lines":[{"line_number":1176,"context_line":"                    d.name[len(dev_prefix):] not in dhcp_port.id):"},{"line_number":1177,"context_line":"                    LOG.debug(\"Found stale device %s, deleting\", d.name)"},{"line_number":1178,"context_line":"                    # stale tap device"},{"line_number":1179,"context_line":"                    self.driver.unplug(d.name, namespace\u003dnetwork.namespace,"},{"line_number":1180,"context_line":"                                       prefix\u003ddev_prefix)"},{"line_number":1181,"context_line":"        except Exception:"},{"line_number":1182,"context_line":"            LOG.exception(_LE(\"Exception during stale port cleanup\"))"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa80f949_ed3f9ed4","line":1179,"in_reply_to":"fa80f949_6dc5ee59","updated":"2015-11-03 14:52:47.000000000","message":"python suggest to have as less as possible in try/except clause to prevent from misinterpreting which place thrown an error.\nIn your current code, if something went wrong it can be:\n\n1. fetching IPWrapper\n2. get_devices\n3. trying to check name of device\n4. unplugging.\n\nTo prevent from this, you should catch just the most important part (this, which can fail), and later proceed with everything else. In this case, it could be sth like:\n\n ns_ip \u003d ip_lib.IPWrapper(namespace\u003dnetwork.namespace)\n try:\n     devices \u003d ns_ip.get_devices(exclude_loopback\u003dTrue)\n except Exception:\n     LOG.exception(_LE(\"Cannot get devices\"))\n else:\n     for d in devices:\n         pass","commit_id":"f658deaf1646004bab84b6b6ad3d1b0da82b1202"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"c7f4286fae3fb799c7e6ef162269e37e60204f50","unresolved":false,"context_lines":[{"line_number":1176,"context_line":"                    d.name[len(dev_prefix):] not in dhcp_port.id):"},{"line_number":1177,"context_line":"                    LOG.debug(\"Found stale device %s, deleting\", d.name)"},{"line_number":1178,"context_line":"                    # stale tap device"},{"line_number":1179,"context_line":"                    self.driver.unplug(d.name, namespace\u003dnetwork.namespace,"},{"line_number":1180,"context_line":"                                       prefix\u003ddev_prefix)"},{"line_number":1181,"context_line":"        except Exception:"},{"line_number":1182,"context_line":"            LOG.exception(_LE(\"Exception during stale port cleanup\"))"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa80f949_dc310ba4","line":1179,"in_reply_to":"fa80f949_ed3f9ed4","updated":"2015-11-04 09:27:06.000000000","message":"Ok, this makes sense, indeed. However I start thinking that may be not nessessary.\nThe idea to add exception handling came when I tried to backport it to Juno where the code was slightly different.\nCurrently get_devices are not wrapped in try-catch anywhere through the code, so I think I\u0027ll just move back to the previous version.","commit_id":"f658deaf1646004bab84b6b6ad3d1b0da82b1202"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"8169e0e2e2d1c928528e8221cbc26379f49ea184","unresolved":false,"context_lines":[{"line_number":1176,"context_line":"                    d.name[len(dev_prefix):] not in dhcp_port.id):"},{"line_number":1177,"context_line":"                    LOG.debug(\"Found stale device %s, deleting\", d.name)"},{"line_number":1178,"context_line":"                    # stale tap device"},{"line_number":1179,"context_line":"                    self.driver.unplug(d.name, namespace\u003dnetwork.namespace,"},{"line_number":1180,"context_line":"                                       prefix\u003ddev_prefix)"},{"line_number":1181,"context_line":"        except Exception:"},{"line_number":1182,"context_line":"            LOG.exception(_LE(\"Exception during stale port cleanup\"))"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa80f949_6dc5ee59","line":1179,"in_reply_to":"fa80f949_eda9dee0","updated":"2015-11-03 14:42:21.000000000","message":"and how is it better than this code?","commit_id":"f658deaf1646004bab84b6b6ad3d1b0da82b1202"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"d0fe73b09fd5542355f69e783cf7fd35138c050f","unresolved":false,"context_lines":[{"line_number":1178,"context_line":"                    # stale tap device"},{"line_number":1179,"context_line":"                    self.driver.unplug(d.name, namespace\u003dnetwork.namespace,"},{"line_number":1180,"context_line":"                                       prefix\u003ddev_prefix)"},{"line_number":1181,"context_line":"        except Exception:"},{"line_number":1182,"context_line":"            LOG.exception(_LE(\"Exception during stale port cleanup\"))"},{"line_number":1183,"context_line":""},{"line_number":1184,"context_line":"    def setup(self, network):"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa80f949_4f4b42b1","line":1181,"updated":"2015-11-03 14:22:57.000000000","message":"Is this necessary? It\u0027ll catch *everything*.\n\nI\u0027ve checked whole codebase for neutron and unplugging is nowhere in try/except clause. Maybe it\u0027s not necessary here?","commit_id":"f658deaf1646004bab84b6b6ad3d1b0da82b1202"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"ee0202f7e7c607af1047c216f3b58ee76aad8fa6","unresolved":false,"context_lines":[{"line_number":1178,"context_line":"                    # stale tap device"},{"line_number":1179,"context_line":"                    self.driver.unplug(d.name, namespace\u003dnetwork.namespace,"},{"line_number":1180,"context_line":"                                       prefix\u003ddev_prefix)"},{"line_number":1181,"context_line":"        except Exception:"},{"line_number":1182,"context_line":"            LOG.exception(_LE(\"Exception during stale port cleanup\"))"},{"line_number":1183,"context_line":""},{"line_number":1184,"context_line":"    def setup(self, network):"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa80f949_f25f7d73","line":1181,"in_reply_to":"fa80f949_4f4b42b1","updated":"2015-11-03 14:33:51.000000000","message":"That\u0027s because it\u0027s not for unplug.","commit_id":"f658deaf1646004bab84b6b6ad3d1b0da82b1202"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"aea2eb1f6663d63c5ea799350e0ea3b9be957145","unresolved":false,"context_lines":[{"line_number":1165,"context_line":"        else:"},{"line_number":1166,"context_line":"            network.ports.append(port)"},{"line_number":1167,"context_line":""},{"line_number":1168,"context_line":"    def cleanup_stale_ports(self, network, dhcp_port):"},{"line_number":1169,"context_line":"        LOG.debug(\"Cleaning stale ports for network %s\", network.id)"},{"line_number":1170,"context_line":"        dev_prefix \u003d constants.TAP_DEVICE_PREFIX"},{"line_number":1171,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(namespace\u003dnetwork.namespace)"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa80f949_8bf813e7","line":1168,"updated":"2015-11-04 11:27:35.000000000","message":"consider using _cleanup_stale_ports as this is an internal method","commit_id":"c6c48c3f0360cdea27d3d16cd5846b0b0161aeb8"},{"author":{"_account_id":16707,"name":"Mohankumar","email":"nmohankumar1011@gmail.com","username":"mohankumar_n"},"change_message_id":"48e01232545741a30c5ea8f68742ec413a49c892","unresolved":false,"context_lines":[{"line_number":1165,"context_line":"        else:"},{"line_number":1166,"context_line":"            network.ports.append(port)"},{"line_number":1167,"context_line":""},{"line_number":1168,"context_line":"    def cleanup_stale_ports(self, network, dhcp_port):"},{"line_number":1169,"context_line":"        LOG.debug(\"Cleaning stale ports for network %s\", network.id)"},{"line_number":1170,"context_line":"        dev_prefix \u003d constants.TAP_DEVICE_PREFIX"},{"line_number":1171,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(namespace\u003dnetwork.namespace)"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa80f949_1989cf26","line":1168,"in_reply_to":"fa80f949_8bf813e7","updated":"2015-11-04 17:40:29.000000000","message":"+1","commit_id":"c6c48c3f0360cdea27d3d16cd5846b0b0161aeb8"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"479154c4ef30d62e2e7b49fb0eb5e4a691687cf9","unresolved":false,"context_lines":[{"line_number":1165,"context_line":"        else:"},{"line_number":1166,"context_line":"            network.ports.append(port)"},{"line_number":1167,"context_line":""},{"line_number":1168,"context_line":"    def cleanup_stale_ports(self, network, dhcp_port):"},{"line_number":1169,"context_line":"        LOG.debug(\"Cleaning stale ports for network %s\", network.id)"},{"line_number":1170,"context_line":"        dev_prefix \u003d constants.TAP_DEVICE_PREFIX"},{"line_number":1171,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(namespace\u003dnetwork.namespace)"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa80f949_7cf814e6","line":1168,"in_reply_to":"fa80f949_8bf813e7","updated":"2015-11-04 14:07:43.000000000","message":"agree","commit_id":"c6c48c3f0360cdea27d3d16cd5846b0b0161aeb8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"aea2eb1f6663d63c5ea799350e0ea3b9be957145","unresolved":false,"context_lines":[{"line_number":1228,"context_line":""},{"line_number":1229,"context_line":"        if self.conf.use_namespaces:"},{"line_number":1230,"context_line":"            self._set_default_route(network, interface_name)"},{"line_number":1231,"context_line":"            self.cleanup_stale_ports(network, port)"},{"line_number":1232,"context_line":""},{"line_number":1233,"context_line":"        return interface_name"},{"line_number":1234,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa80f949_0be50336","line":1231,"updated":"2015-11-04 11:27:35.000000000","message":"do we want to do this under a try condition?","commit_id":"c6c48c3f0360cdea27d3d16cd5846b0b0161aeb8"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"479154c4ef30d62e2e7b49fb0eb5e4a691687cf9","unresolved":false,"context_lines":[{"line_number":1228,"context_line":""},{"line_number":1229,"context_line":"        if self.conf.use_namespaces:"},{"line_number":1230,"context_line":"            self._set_default_route(network, interface_name)"},{"line_number":1231,"context_line":"            self.cleanup_stale_ports(network, port)"},{"line_number":1232,"context_line":""},{"line_number":1233,"context_line":"        return interface_name"},{"line_number":1234,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa80f949_5cf3d00a","line":1231,"in_reply_to":"fa80f949_0be50336","updated":"2015-11-04 14:07:43.000000000","message":"On one hand, according to usage of system calls in other places, such operations are not wrapped by try-expect (neither getting the device list nor unplugging), on the other hand, it\u0027s bad to cleanup will prevent DHCP from being configured...","commit_id":"c6c48c3f0360cdea27d3d16cd5846b0b0161aeb8"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"7b05420a0bbb5e817b6147e3b8a35f9f967a6010","unresolved":false,"context_lines":[{"line_number":1165,"context_line":"        else:"},{"line_number":1166,"context_line":"            network.ports.append(port)"},{"line_number":1167,"context_line":""},{"line_number":1168,"context_line":"    def _cleanup_stale_ports(self, network, dhcp_port):"},{"line_number":1169,"context_line":"        LOG.debug(\"Cleaning stale ports for network %s\", network.id)"},{"line_number":1170,"context_line":"        dev_prefix \u003d constants.TAP_DEVICE_PREFIX"},{"line_number":1171,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(namespace\u003dnetwork.namespace)"}],"source_content_type":"text/x-python","patch_set":11,"id":"da85f559_6080eac0","line":1168,"updated":"2015-11-11 18:00:28.000000000","message":"Looking at this method as a whole, it doesn\u0027t seem like it belongs here in the dhcp code, seems like it should live in interface.py, but I think if you tweak it I might be Ok with it.\n\nnit: s/_cleanup_stale_ports/_cleanup_stale_devices","commit_id":"44edec3b083f6d994115bb81dbdc7cb68afc5025"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"756a0af4afebe66391131fa8967c1c4c321b9051","unresolved":false,"context_lines":[{"line_number":1165,"context_line":"        else:"},{"line_number":1166,"context_line":"            network.ports.append(port)"},{"line_number":1167,"context_line":""},{"line_number":1168,"context_line":"    def _cleanup_stale_ports(self, network, dhcp_port):"},{"line_number":1169,"context_line":"        LOG.debug(\"Cleaning stale ports for network %s\", network.id)"},{"line_number":1170,"context_line":"        dev_prefix \u003d constants.TAP_DEVICE_PREFIX"},{"line_number":1171,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(namespace\u003dnetwork.namespace)"}],"source_content_type":"text/x-python","patch_set":11,"id":"da85f559_631b0f74","line":1168,"in_reply_to":"da85f559_6080eac0","updated":"2015-11-11 19:48:35.000000000","message":"OK, i don\u0027t mind","commit_id":"44edec3b083f6d994115bb81dbdc7cb68afc5025"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"7b05420a0bbb5e817b6147e3b8a35f9f967a6010","unresolved":false,"context_lines":[{"line_number":1166,"context_line":"            network.ports.append(port)"},{"line_number":1167,"context_line":""},{"line_number":1168,"context_line":"    def _cleanup_stale_ports(self, network, dhcp_port):"},{"line_number":1169,"context_line":"        LOG.debug(\"Cleaning stale ports for network %s\", network.id)"},{"line_number":1170,"context_line":"        dev_prefix \u003d constants.TAP_DEVICE_PREFIX"},{"line_number":1171,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(namespace\u003dnetwork.namespace)"},{"line_number":1172,"context_line":"        for d in ns_ip.get_devices(exclude_loopback\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":11,"id":"da85f559_c0151640","line":1169,"updated":"2015-11-11 18:00:28.000000000","message":"nit: s/ports/devices","commit_id":"44edec3b083f6d994115bb81dbdc7cb68afc5025"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"7b05420a0bbb5e817b6147e3b8a35f9f967a6010","unresolved":false,"context_lines":[{"line_number":1167,"context_line":""},{"line_number":1168,"context_line":"    def _cleanup_stale_ports(self, network, dhcp_port):"},{"line_number":1169,"context_line":"        LOG.debug(\"Cleaning stale ports for network %s\", network.id)"},{"line_number":1170,"context_line":"        dev_prefix \u003d constants.TAP_DEVICE_PREFIX"},{"line_number":1171,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(namespace\u003dnetwork.namespace)"},{"line_number":1172,"context_line":"        for d in ns_ip.get_devices(exclude_loopback\u003dTrue):"},{"line_number":1173,"context_line":"            # delete all ports except current active DHCP port"}],"source_content_type":"text/x-python","patch_set":11,"id":"da85f559_c0faf674","line":1170,"updated":"2015-11-11 18:00:28.000000000","message":"dev_name \u003d self.driver.get_device_name(dhcp_port)\n\ni.e. the name of the one you want to keep, which keeps interface tap device knowledge out of this file","commit_id":"44edec3b083f6d994115bb81dbdc7cb68afc5025"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"7b05420a0bbb5e817b6147e3b8a35f9f967a6010","unresolved":false,"context_lines":[{"line_number":1172,"context_line":"        for d in ns_ip.get_devices(exclude_loopback\u003dTrue):"},{"line_number":1173,"context_line":"            # delete all ports except current active DHCP port"},{"line_number":1174,"context_line":"            if (d.name.startswith(dev_prefix) and"},{"line_number":1175,"context_line":"                d.name[len(dev_prefix):] not in dhcp_port.id):"},{"line_number":1176,"context_line":"                LOG.debug(\"Found stale device %s, deleting\", d.name)"},{"line_number":1177,"context_line":"                # stale tap device"},{"line_number":1178,"context_line":"                self.driver.unplug(d.name, namespace\u003dnetwork.namespace,"}],"source_content_type":"text/x-python","patch_set":11,"id":"da85f559_a0ed72b8","line":1175,"updated":"2015-11-11 18:00:28.000000000","message":"if d.name !\u003d dev_name:","commit_id":"44edec3b083f6d994115bb81dbdc7cb68afc5025"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"756a0af4afebe66391131fa8967c1c4c321b9051","unresolved":false,"context_lines":[{"line_number":1172,"context_line":"        for d in ns_ip.get_devices(exclude_loopback\u003dTrue):"},{"line_number":1173,"context_line":"            # delete all ports except current active DHCP port"},{"line_number":1174,"context_line":"            if (d.name.startswith(dev_prefix) and"},{"line_number":1175,"context_line":"                d.name[len(dev_prefix):] not in dhcp_port.id):"},{"line_number":1176,"context_line":"                LOG.debug(\"Found stale device %s, deleting\", d.name)"},{"line_number":1177,"context_line":"                # stale tap device"},{"line_number":1178,"context_line":"                self.driver.unplug(d.name, namespace\u003dnetwork.namespace,"}],"source_content_type":"text/x-python","patch_set":11,"id":"da85f559_2328a785","line":1175,"in_reply_to":"da85f559_a0ed72b8","updated":"2015-11-11 19:48:35.000000000","message":"ok","commit_id":"44edec3b083f6d994115bb81dbdc7cb68afc5025"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"7b05420a0bbb5e817b6147e3b8a35f9f967a6010","unresolved":false,"context_lines":[{"line_number":1174,"context_line":"            if (d.name.startswith(dev_prefix) and"},{"line_number":1175,"context_line":"                d.name[len(dev_prefix):] not in dhcp_port.id):"},{"line_number":1176,"context_line":"                LOG.debug(\"Found stale device %s, deleting\", d.name)"},{"line_number":1177,"context_line":"                # stale tap device"},{"line_number":1178,"context_line":"                self.driver.unplug(d.name, namespace\u003dnetwork.namespace,"},{"line_number":1179,"context_line":"                                   prefix\u003ddev_prefix)"},{"line_number":1180,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"da85f559_80a86e21","line":1177,"updated":"2015-11-11 18:00:28.000000000","message":"not needed with debug statement saying same thing","commit_id":"44edec3b083f6d994115bb81dbdc7cb68afc5025"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"7b05420a0bbb5e817b6147e3b8a35f9f967a6010","unresolved":false,"context_lines":[{"line_number":1176,"context_line":"                LOG.debug(\"Found stale device %s, deleting\", d.name)"},{"line_number":1177,"context_line":"                # stale tap device"},{"line_number":1178,"context_line":"                self.driver.unplug(d.name, namespace\u003dnetwork.namespace,"},{"line_number":1179,"context_line":"                                   prefix\u003ddev_prefix)"},{"line_number":1180,"context_line":""},{"line_number":1181,"context_line":"    def setup(self, network):"},{"line_number":1182,"context_line":"        \"\"\"Create and initialize a device for network\u0027s DHCP on this host.\"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"da85f559_8075cefa","line":1179,"updated":"2015-11-11 18:00:28.000000000","message":"prefix isn\u0027t necessary here with above changes.","commit_id":"44edec3b083f6d994115bb81dbdc7cb68afc5025"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"79bdc0e2545b4f8bcd1d866aef8272b29d4ff151","unresolved":false,"context_lines":[{"line_number":1229,"context_line":"        if self.conf.use_namespaces:"},{"line_number":1230,"context_line":"            self._set_default_route(network, interface_name)"},{"line_number":1231,"context_line":"            try:"},{"line_number":1232,"context_line":"                self._cleanup_stale_ports(network, port)"},{"line_number":1233,"context_line":"            except Exception:"},{"line_number":1234,"context_line":"                # catch everything as we don\u0027t want to fail because of"},{"line_number":1235,"context_line":"                # cleanup step"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa80f949_7f0758ca","line":1232,"updated":"2015-11-06 06:13:48.000000000","message":"_cleanup_stale_ports itself looks nice to me, thanks for that. But from commit message:\n\"but it\u0027s not guaranteed that they get exactly same ports. In such case DHCP agent may create interface in the namespaces despite that another interface already exist\".\nI think it\u0027s not necessary to let method always run for all three _setup_*_dhcp_port cases, make it only run for _setup_reserved_dhcp_port seems better.","commit_id":"44edec3b083f6d994115bb81dbdc7cb68afc5025"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"b74f6d34a346e959c8155bb8e00d03b395a76063","unresolved":false,"context_lines":[{"line_number":1229,"context_line":"        if self.conf.use_namespaces:"},{"line_number":1230,"context_line":"            self._set_default_route(network, interface_name)"},{"line_number":1231,"context_line":"            try:"},{"line_number":1232,"context_line":"                self._cleanup_stale_ports(network, port)"},{"line_number":1233,"context_line":"            except Exception:"},{"line_number":1234,"context_line":"                # catch everything as we don\u0027t want to fail because of"},{"line_number":1235,"context_line":"                # cleanup step"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa80f949_7f14389f","line":1232,"in_reply_to":"fa80f949_7f0758ca","updated":"2015-11-06 06:28:26.000000000","message":"That would be incorrect.\nCleanup must run in any case. Multiple ports are not the result of any of the setup* methods but of previous dhcp agent runs with different dhcp ports.","commit_id":"44edec3b083f6d994115bb81dbdc7cb68afc5025"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"147973b4ef9c8a58e698bf96ff5ef4ff1e7534f3","unresolved":false,"context_lines":[{"line_number":1229,"context_line":"        if self.conf.use_namespaces:"},{"line_number":1230,"context_line":"            self._set_default_route(network, interface_name)"},{"line_number":1231,"context_line":"            try:"},{"line_number":1232,"context_line":"                self._cleanup_stale_ports(network, port)"},{"line_number":1233,"context_line":"            except Exception:"},{"line_number":1234,"context_line":"                # catch everything as we don\u0027t want to fail because of"},{"line_number":1235,"context_line":"                # cleanup step"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa80f949_fd2fd085","line":1232,"in_reply_to":"fa80f949_7f14389f","updated":"2015-11-06 07:27:13.000000000","message":"OK, I can see cleanup must run for cases _setup_reserved_dhcp_port and _setup_new_dhcp_port now. But after cleanup run for the two cases, it will make sure there is no stale ports in network namespace. so when next time dhcp-agent starts after dead for a while, if _setup_existing_dhcp_port matches a dhcp-port, that must be the one dhcp-agent used last time, so still no stale port will be created.\n\nWell, put it here will make things simple, I think I can accept this.","commit_id":"44edec3b083f6d994115bb81dbdc7cb68afc5025"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"102dabe1b0e368f694229f49e99765e7775ba6fc","unresolved":false,"context_lines":[{"line_number":1230,"context_line":"            except Exception:"},{"line_number":1231,"context_line":"                # catch everything as we don\u0027t want to fail because of"},{"line_number":1232,"context_line":"                # cleanup step"},{"line_number":1233,"context_line":"                LOG.info(_LI(\"Exception during stale dhcp device cleanup\"))"},{"line_number":1234,"context_line":""},{"line_number":1235,"context_line":"        return interface_name"},{"line_number":1236,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"da85f559_d7104b5b","line":1233,"updated":"2015-11-12 14:02:51.000000000","message":"Can we raise the log level here? To warn maybe.\n\nExcept neutron/tests folder, the only place I find is using info level in exception is https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/managers.py#L816-L818 .\n\nAnd to L1169 and L1175, I agree with Brian, it seems no need to debug duplicated messages.","commit_id":"fe8f533e44b05207eaa6e6c4ed42a8cc3c415993"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"b9aee6f4ac1ae1301f976f5ed4fdd8345f03e32b","unresolved":false,"context_lines":[{"line_number":1230,"context_line":"            except Exception:"},{"line_number":1231,"context_line":"                # catch everything as we don\u0027t want to fail because of"},{"line_number":1232,"context_line":"                # cleanup step"},{"line_number":1233,"context_line":"                LOG.info(_LI(\"Exception during stale dhcp device cleanup\"))"},{"line_number":1234,"context_line":""},{"line_number":1235,"context_line":"        return interface_name"},{"line_number":1236,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"da85f559_00d43045","line":1233,"in_reply_to":"da85f559_d7104b5b","updated":"2015-11-12 21:25:18.000000000","message":"ok","commit_id":"fe8f533e44b05207eaa6e6c4ed42a8cc3c415993"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"29290365ff24edc4c103f99848403843128fb9e8","unresolved":false,"context_lines":[{"line_number":1166,"context_line":"            network.ports.append(port)"},{"line_number":1167,"context_line":""},{"line_number":1168,"context_line":"    def _cleanup_stale_devices(self, network, dhcp_port):"},{"line_number":1169,"context_line":"        LOG.debug(\"Cleaning stale devices for network %s\", network.id)"},{"line_number":1170,"context_line":"        dev_name \u003d self.driver.get_device_name(dhcp_port)"},{"line_number":1171,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(namespace\u003dnetwork.namespace)"},{"line_number":1172,"context_line":"        for d in ns_ip.get_devices(exclude_loopback\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":13,"id":"da85f559_bc9211f5","line":1169,"updated":"2015-11-13 12:54:59.000000000","message":"not sure this is useful debug info","commit_id":"32cc08cf34ab8da935e29a782c115f4cf3379ec3"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"5966ab4579b4343a5f04e753488df42098379a08","unresolved":false,"context_lines":[{"line_number":1166,"context_line":"            network.ports.append(port)"},{"line_number":1167,"context_line":""},{"line_number":1168,"context_line":"    def _cleanup_stale_devices(self, network, dhcp_port):"},{"line_number":1169,"context_line":"        LOG.debug(\"Cleaning stale devices for network %s\", network.id)"},{"line_number":1170,"context_line":"        dev_name \u003d self.driver.get_device_name(dhcp_port)"},{"line_number":1171,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(namespace\u003dnetwork.namespace)"},{"line_number":1172,"context_line":"        for d in ns_ip.get_devices(exclude_loopback\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":13,"id":"da85f559_f9cd065e","line":1169,"in_reply_to":"da85f559_bc9211f5","updated":"2015-11-13 15:53:45.000000000","message":"i prefer seeing certain blocks start execution.\nstale devices may or may not be present but developer/operator can be sure that cleanup has worked.","commit_id":"32cc08cf34ab8da935e29a782c115f4cf3379ec3"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"29290365ff24edc4c103f99848403843128fb9e8","unresolved":false,"context_lines":[{"line_number":1172,"context_line":"        for d in ns_ip.get_devices(exclude_loopback\u003dTrue):"},{"line_number":1173,"context_line":"            # delete all devices except current active DHCP port device"},{"line_number":1174,"context_line":"            if d.name !\u003d dev_name:"},{"line_number":1175,"context_line":"                LOG.debug(\"Found stale device %s, deleting\", d.name)"},{"line_number":1176,"context_line":"                self.driver.unplug(d.name, namespace\u003dnetwork.namespace)"},{"line_number":1177,"context_line":""},{"line_number":1178,"context_line":"    def setup(self, network):"}],"source_content_type":"text/x-python","patch_set":13,"id":"da85f559_bca9b126","line":1175,"updated":"2015-11-13 12:54:59.000000000","message":"this one is enough IMO","commit_id":"32cc08cf34ab8da935e29a782c115f4cf3379ec3"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"5966ab4579b4343a5f04e753488df42098379a08","unresolved":false,"context_lines":[{"line_number":1172,"context_line":"        for d in ns_ip.get_devices(exclude_loopback\u003dTrue):"},{"line_number":1173,"context_line":"            # delete all devices except current active DHCP port device"},{"line_number":1174,"context_line":"            if d.name !\u003d dev_name:"},{"line_number":1175,"context_line":"                LOG.debug(\"Found stale device %s, deleting\", d.name)"},{"line_number":1176,"context_line":"                self.driver.unplug(d.name, namespace\u003dnetwork.namespace)"},{"line_number":1177,"context_line":""},{"line_number":1178,"context_line":"    def setup(self, network):"}],"source_content_type":"text/x-python","patch_set":13,"id":"da85f559_b9d77eec","line":1175,"in_reply_to":"da85f559_bca9b126","updated":"2015-11-13 15:53:45.000000000","message":"see above.","commit_id":"32cc08cf34ab8da935e29a782c115f4cf3379ec3"}],"neutron/tests/functional/agent/linux/test_dhcp.py":[{"author":{"_account_id":14615,"name":"Sergey Belous","email":"belous.py@gmail.com","username":"sbelous"},"change_message_id":"6f5cbb8184b10f23580525ba48ca31fd9daf518e","unresolved":false,"context_lines":[{"line_number":78,"context_line":"                            \"10:22:33:44:55:69\","},{"line_number":79,"context_line":"                            namespace\u003d\"qdhcp-foo_id\")"},{"line_number":80,"context_line":"        ipw \u003d ip_lib.IPWrapper(namespace\u003d\"qdhcp-foo_id\")"},{"line_number":81,"context_line":"        self.addCleanup(dev_mgr.driver.unplug, \u0027tapfoo_port_id\u0027)"},{"line_number":82,"context_line":"        self.addCleanup(dev_mgr.driver.unplug, \u0027tapfoo_id3\u0027)"},{"line_number":83,"context_line":"        self.addCleanup(dev_mgr.driver.unplug, \u0027tapfoo_id2\u0027)"},{"line_number":84,"context_line":"        self.addCleanup(ipw.netns.delete, \u0027qdhcp-foo_id\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a26ad4f_05aaf4d4","line":81,"updated":"2015-10-27 15:59:43.000000000","message":"I think we can safely delete cleanup methods (L81-L83) because when we delete the integration bridge any ports on it will also be cleaned up: http://paste.openstack.org/show/412636/\n\n\nPS: Even if we didn\u0027t specify a bridge argument in plug() call, in OVSInterfaceDriver will be used bridge specified in \u0027self.conf[\u0027ovs_integration_bridge\u0027]\u0027","commit_id":"60b51c0267ccc42d5143387097a89c32acf8f543"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"66328460f3923d5027bce5d6b4f3f794e3522852","unresolved":false,"context_lines":[{"line_number":78,"context_line":"                            \"10:22:33:44:55:69\","},{"line_number":79,"context_line":"                            namespace\u003d\"qdhcp-foo_id\")"},{"line_number":80,"context_line":"        ipw \u003d ip_lib.IPWrapper(namespace\u003d\"qdhcp-foo_id\")"},{"line_number":81,"context_line":"        self.addCleanup(dev_mgr.driver.unplug, \u0027tapfoo_port_id\u0027)"},{"line_number":82,"context_line":"        self.addCleanup(dev_mgr.driver.unplug, \u0027tapfoo_id3\u0027)"},{"line_number":83,"context_line":"        self.addCleanup(dev_mgr.driver.unplug, \u0027tapfoo_id2\u0027)"},{"line_number":84,"context_line":"        self.addCleanup(ipw.netns.delete, \u0027qdhcp-foo_id\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a26ad4f_3a094396","line":81,"in_reply_to":"1a26ad4f_05aaf4d4","updated":"2015-10-27 21:32:10.000000000","message":"Done","commit_id":"60b51c0267ccc42d5143387097a89c32acf8f543"},{"author":{"_account_id":14615,"name":"Sergey Belous","email":"belous.py@gmail.com","username":"sbelous"},"change_message_id":"8f9efb09a60881ac73f186e1f144d7a05314a51f","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        conf.register_opts(dhcp_conf.DHCP_AGENT_OPTS)"},{"line_number":39,"context_line":"        conf.set_override(\u0027interface_driver\u0027, \u0027openvswitch\u0027)"},{"line_number":40,"context_line":"        conf.set_override(\u0027host\u0027, \u0027foo_host\u0027)"},{"line_number":41,"context_line":"        conf.set_override(\u0027use_namespaces\u0027, True)"},{"line_number":42,"context_line":"        self.conf \u003d conf"},{"line_number":43,"context_line":"        br_int \u003d self.useFixture(net_helpers.OVSBridgeFixture()).bridge"},{"line_number":44,"context_line":"        self.conf.set_override(\u0027ovs_integration_bridge\u0027, br_int.br_name)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a26ad4f_0f918f99","line":41,"range":{"start_line":41,"start_character":27,"end_line":41,"end_character":41},"updated":"2015-10-28 16:22:19.000000000","message":"small nit: use_namespaces is True by default","commit_id":"82c65e169955970ef7cba008786fa3556278abbf"},{"author":{"_account_id":14615,"name":"Sergey Belous","email":"belous.py@gmail.com","username":"sbelous"},"change_message_id":"8f9efb09a60881ac73f186e1f144d7a05314a51f","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        self.conf \u003d conf"},{"line_number":43,"context_line":"        br_int \u003d self.useFixture(net_helpers.OVSBridgeFixture()).bridge"},{"line_number":44,"context_line":"        self.conf.set_override(\u0027ovs_integration_bridge\u0027, br_int.br_name)"},{"line_number":45,"context_line":"        self.interface \u003d interface.OVSInterfaceDriver(conf)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def test_cleanup_stale_ports(self):"},{"line_number":48,"context_line":"        plugin \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a26ad4f_9241440e","line":45,"range":{"start_line":45,"start_character":54,"end_line":45,"end_character":58},"updated":"2015-10-28 16:22:19.000000000","message":"I think it is better to use \u0027self.conf\u0027 everywhere, instead of \u0027conf\u0027.  Just for consistency. What do you think? :)","commit_id":"82c65e169955970ef7cba008786fa3556278abbf"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"c1da9f708b96df68b5b00a3e7d3c347f87eb5c3c","unresolved":false,"context_lines":[{"line_number":51,"context_line":"            \u0027id\u0027: \u0027foo_id\u0027,"},{"line_number":52,"context_line":"            \u0027tenant_id\u0027: \u0027foo_tenant\u0027,"},{"line_number":53,"context_line":"            \u0027namespace\u0027: \u0027qdhcp-foo_id\u0027,"},{"line_number":54,"context_line":"            \u0027ports\u0027: [],"},{"line_number":55,"context_line":"            \u0027subnets\u0027: [tests_base.AttributeDict({\u0027id\u0027: \u0027subnet_foo_id\u0027,"},{"line_number":56,"context_line":"                                                  \u0027enable_dhcp\u0027: True,"},{"line_number":57,"context_line":"                                                  \u0027ipv6_address_mode\u0027: None,"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa80f949_a97b4e8b","line":54,"updated":"2015-11-06 04:12:10.000000000","message":"You sure that ports here should be empty? The ports here should contains all ports on the network, like instance port and dhcp port. I don\u0027t think the case this patch try to deal with will clean ports belong to network in db.","commit_id":"44edec3b083f6d994115bb81dbdc7cb68afc5025"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"7d6c6936a5dda5e880c78bc9e37dee41d9125655","unresolved":false,"context_lines":[{"line_number":51,"context_line":"            \u0027id\u0027: \u0027foo_id\u0027,"},{"line_number":52,"context_line":"            \u0027tenant_id\u0027: \u0027foo_tenant\u0027,"},{"line_number":53,"context_line":"            \u0027namespace\u0027: \u0027qdhcp-foo_id\u0027,"},{"line_number":54,"context_line":"            \u0027ports\u0027: [],"},{"line_number":55,"context_line":"            \u0027subnets\u0027: [tests_base.AttributeDict({\u0027id\u0027: \u0027subnet_foo_id\u0027,"},{"line_number":56,"context_line":"                                                  \u0027enable_dhcp\u0027: True,"},{"line_number":57,"context_line":"                                                  \u0027ipv6_address_mode\u0027: None,"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa80f949_ac67dc4b","line":54,"in_reply_to":"fa80f949_a97b4e8b","updated":"2015-11-06 05:45:57.000000000","message":"I\u0027m testing cleanup method, not building hosts file or spawning dnsmasq, so i don\u0027t need any ports.","commit_id":"44edec3b083f6d994115bb81dbdc7cb68afc5025"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"79bdc0e2545b4f8bcd1d866aef8272b29d4ff151","unresolved":false,"context_lines":[{"line_number":51,"context_line":"            \u0027id\u0027: \u0027foo_id\u0027,"},{"line_number":52,"context_line":"            \u0027tenant_id\u0027: \u0027foo_tenant\u0027,"},{"line_number":53,"context_line":"            \u0027namespace\u0027: \u0027qdhcp-foo_id\u0027,"},{"line_number":54,"context_line":"            \u0027ports\u0027: [],"},{"line_number":55,"context_line":"            \u0027subnets\u0027: [tests_base.AttributeDict({\u0027id\u0027: \u0027subnet_foo_id\u0027,"},{"line_number":56,"context_line":"                                                  \u0027enable_dhcp\u0027: True,"},{"line_number":57,"context_line":"                                                  \u0027ipv6_address_mode\u0027: None,"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa80f949_9f7b1c8c","line":54,"in_reply_to":"fa80f949_ac67dc4b","updated":"2015-11-06 06:13:48.000000000","message":"Well, if just want to test cleanup method, you may no need to call device_manager.setup, I saw it been called, so I suppose you wanna test more.\n\nYes, I know building dnsmasq config files and spawning process is not necessary here, network is just needed by device_manger.setup. But I still think setting ports empty goes far away than the scenario described in commit message.","commit_id":"44edec3b083f6d994115bb81dbdc7cb68afc5025"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"c1da9f708b96df68b5b00a3e7d3c347f87eb5c3c","unresolved":false,"context_lines":[{"line_number":65,"context_line":"            \u0027fixed_ips\u0027: [tests_base.AttributeDict("},{"line_number":66,"context_line":"                {\u0027subnet_id\u0027: \u0027subnet_foo_id\u0027, \u0027ip_address\u0027: \u002710.0.0.1\u0027})]"},{"line_number":67,"context_line":"        }"},{"line_number":68,"context_line":"        plugin.create_dhcp_port.return_value \u003d tests_base.AttributeDict("},{"line_number":69,"context_line":"            dhcp_port)"},{"line_number":70,"context_line":"        dev_mgr.driver.plug(\"foo_id\","},{"line_number":71,"context_line":"                            \"foo_id2\","}],"source_content_type":"text/x-python","patch_set":11,"id":"fa80f949_49f18200","line":68,"updated":"2015-11-06 04:12:10.000000000","message":"Why we need mock create_dhcp_port here, it will work for _setup_new_dhcp_port.  _setup_existing_dhcp_port and _setup_reserved_dhcp_port should go first.\n\nOops, you network ports empty, so setup method for existing and reserved port will not get run. Its behavior like create a new network and let dhcp-agent to host, but not to wake up dead dhcp-agent while network is still existing.","commit_id":"44edec3b083f6d994115bb81dbdc7cb68afc5025"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"7d6c6936a5dda5e880c78bc9e37dee41d9125655","unresolved":false,"context_lines":[{"line_number":65,"context_line":"            \u0027fixed_ips\u0027: [tests_base.AttributeDict("},{"line_number":66,"context_line":"                {\u0027subnet_id\u0027: \u0027subnet_foo_id\u0027, \u0027ip_address\u0027: \u002710.0.0.1\u0027})]"},{"line_number":67,"context_line":"        }"},{"line_number":68,"context_line":"        plugin.create_dhcp_port.return_value \u003d tests_base.AttributeDict("},{"line_number":69,"context_line":"            dhcp_port)"},{"line_number":70,"context_line":"        dev_mgr.driver.plug(\"foo_id\","},{"line_number":71,"context_line":"                            \"foo_id2\","}],"source_content_type":"text/x-python","patch_set":11,"id":"fa80f949_ccfa6043","line":68,"in_reply_to":"fa80f949_49f18200","updated":"2015-11-06 05:45:57.000000000","message":"The ultimate goal here is to build dhcp network namespace with dhcp port, and not fully emulate enabling dhcp for a network, and then clean it up.\n\nIf I could provide less parameters to dev_mgr, I would do that.","commit_id":"44edec3b083f6d994115bb81dbdc7cb68afc5025"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"147973b4ef9c8a58e698bf96ff5ef4ff1e7534f3","unresolved":false,"context_lines":[{"line_number":65,"context_line":"            \u0027fixed_ips\u0027: [tests_base.AttributeDict("},{"line_number":66,"context_line":"                {\u0027subnet_id\u0027: \u0027subnet_foo_id\u0027, \u0027ip_address\u0027: \u002710.0.0.1\u0027})]"},{"line_number":67,"context_line":"        }"},{"line_number":68,"context_line":"        plugin.create_dhcp_port.return_value \u003d tests_base.AttributeDict("},{"line_number":69,"context_line":"            dhcp_port)"},{"line_number":70,"context_line":"        dev_mgr.driver.plug(\"foo_id\","},{"line_number":71,"context_line":"                            \"foo_id2\","}],"source_content_type":"text/x-python","patch_set":11,"id":"fa80f949_bd3e288a","line":68,"in_reply_to":"fa80f949_5f8614dc","updated":"2015-11-06 07:27:13.000000000","message":"Well, I think I get your point now, even though it still seems a little strange to me. Thanks for your explanation.","commit_id":"44edec3b083f6d994115bb81dbdc7cb68afc5025"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"79bdc0e2545b4f8bcd1d866aef8272b29d4ff151","unresolved":false,"context_lines":[{"line_number":65,"context_line":"            \u0027fixed_ips\u0027: [tests_base.AttributeDict("},{"line_number":66,"context_line":"                {\u0027subnet_id\u0027: \u0027subnet_foo_id\u0027, \u0027ip_address\u0027: \u002710.0.0.1\u0027})]"},{"line_number":67,"context_line":"        }"},{"line_number":68,"context_line":"        plugin.create_dhcp_port.return_value \u003d tests_base.AttributeDict("},{"line_number":69,"context_line":"            dhcp_port)"},{"line_number":70,"context_line":"        dev_mgr.driver.plug(\"foo_id\","},{"line_number":71,"context_line":"                            \"foo_id2\","}],"source_content_type":"text/x-python","patch_set":11,"id":"fa80f949_ffdfc866","line":68,"in_reply_to":"fa80f949_ccfa6043","updated":"2015-11-06 06:13:48.000000000","message":"Sorry, I\u0027m not quite understand \"build\" you mentioned. If we need to build a new namespace, that means namespace for special network doesn\u0027t exist before, and so do stale dhcp-port.\n\nYes, passing less parameters is better way, but I\u0027m still confuse whether the UT is designed for case described in commit message.","commit_id":"44edec3b083f6d994115bb81dbdc7cb68afc5025"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"b74f6d34a346e959c8155bb8e00d03b395a76063","unresolved":false,"context_lines":[{"line_number":65,"context_line":"            \u0027fixed_ips\u0027: [tests_base.AttributeDict("},{"line_number":66,"context_line":"                {\u0027subnet_id\u0027: \u0027subnet_foo_id\u0027, \u0027ip_address\u0027: \u002710.0.0.1\u0027})]"},{"line_number":67,"context_line":"        }"},{"line_number":68,"context_line":"        plugin.create_dhcp_port.return_value \u003d tests_base.AttributeDict("},{"line_number":69,"context_line":"            dhcp_port)"},{"line_number":70,"context_line":"        dev_mgr.driver.plug(\"foo_id\","},{"line_number":71,"context_line":"                            \"foo_id2\","}],"source_content_type":"text/x-python","patch_set":11,"id":"fa80f949_5f8614dc","line":68,"in_reply_to":"fa80f949_ffdfc866","updated":"2015-11-06 06:28:26.000000000","message":"This is functional test, which creates a namespace, plugs several stale ports in it, then run DeviceManager.setup() which would add dhcp port to a namespace and then delete other ports.\n\nI don\u0027t need ports[] to be filled to accomplish that, and also I can\u0027t avoid mocking plugin, becase it\u0027s rpc interface and i don\u0027t want to involve that.","commit_id":"44edec3b083f6d994115bb81dbdc7cb68afc5025"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"29290365ff24edc4c103f99848403843128fb9e8","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        self.conf \u003d conf"},{"line_number":43,"context_line":"        br_int \u003d self.useFixture(net_helpers.OVSBridgeFixture()).bridge"},{"line_number":44,"context_line":"        self.conf.set_override(\u0027ovs_integration_bridge\u0027, br_int.br_name)"},{"line_number":45,"context_line":"        self.interface \u003d interface.OVSInterfaceDriver(conf)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def test_cleanup_stale_devices(self):"},{"line_number":48,"context_line":"        plugin \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":13,"id":"da85f559_dca9157d","line":45,"updated":"2015-11-13 12:54:59.000000000","message":"where is it used?","commit_id":"32cc08cf34ab8da935e29a782c115f4cf3379ec3"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"5966ab4579b4343a5f04e753488df42098379a08","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        self.conf \u003d conf"},{"line_number":43,"context_line":"        br_int \u003d self.useFixture(net_helpers.OVSBridgeFixture()).bridge"},{"line_number":44,"context_line":"        self.conf.set_override(\u0027ovs_integration_bridge\u0027, br_int.br_name)"},{"line_number":45,"context_line":"        self.interface \u003d interface.OVSInterfaceDriver(conf)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def test_cleanup_stale_devices(self):"},{"line_number":48,"context_line":"        plugin \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":13,"id":"da85f559_79bef6d5","line":45,"in_reply_to":"da85f559_dca9157d","updated":"2015-11-13 15:53:45.000000000","message":"Done","commit_id":"32cc08cf34ab8da935e29a782c115f4cf3379ec3"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"29290365ff24edc4c103f99848403843128fb9e8","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        dev_mgr.setup(tests_base.AttributeDict(network))"},{"line_number":84,"context_line":"        devices \u003d ipw.get_devices(exclude_loopback\u003dTrue)"},{"line_number":85,"context_line":"        # only one non-loopback device should remain"},{"line_number":86,"context_line":"        self.assertEqual(1, len(devices))"},{"line_number":87,"context_line":"        self.assertEqual(\"tapfoo_port_id\", devices[0].name)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da85f559_3ce701ae","line":86,"updated":"2015-11-13 12:54:59.000000000","message":"may also check for devices before setup dhcp for network","commit_id":"32cc08cf34ab8da935e29a782c115f4cf3379ec3"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"5966ab4579b4343a5f04e753488df42098379a08","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        dev_mgr.setup(tests_base.AttributeDict(network))"},{"line_number":84,"context_line":"        devices \u003d ipw.get_devices(exclude_loopback\u003dTrue)"},{"line_number":85,"context_line":"        # only one non-loopback device should remain"},{"line_number":86,"context_line":"        self.assertEqual(1, len(devices))"},{"line_number":87,"context_line":"        self.assertEqual(\"tapfoo_port_id\", devices[0].name)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da85f559_fbc3b536","line":86,"in_reply_to":"da85f559_3ce701ae","updated":"2015-11-13 15:53:45.000000000","message":"Done","commit_id":"32cc08cf34ab8da935e29a782c115f4cf3379ec3"}],"neutron/tests/unit/agent/dhcp/test_agent.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"29290365ff24edc4c103f99848403843128fb9e8","unresolved":false,"context_lines":[{"line_number":230,"context_line":"        self.mock_makedirs_p \u003d mock.patch(\"os.makedirs\")"},{"line_number":231,"context_line":"        self.mock_makedirs \u003d self.mock_makedirs_p.start()"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"        self.mock_ip_wrapper_p \u003d mock.patch(\"neutron.agent.linux.ip_lib.\""},{"line_number":234,"context_line":"                                            \"IPWrapper\")"},{"line_number":235,"context_line":"        self.mock_ip_wrapper \u003d self.mock_ip_wrapper_p.start()"},{"line_number":236,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"da85f559_1ccb1d74","line":233,"updated":"2015-11-13 12:54:59.000000000","message":"nit: seems you don\u0027t need it as instance member","commit_id":"32cc08cf34ab8da935e29a782c115f4cf3379ec3"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"5966ab4579b4343a5f04e753488df42098379a08","unresolved":false,"context_lines":[{"line_number":230,"context_line":"        self.mock_makedirs_p \u003d mock.patch(\"os.makedirs\")"},{"line_number":231,"context_line":"        self.mock_makedirs \u003d self.mock_makedirs_p.start()"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"        self.mock_ip_wrapper_p \u003d mock.patch(\"neutron.agent.linux.ip_lib.\""},{"line_number":234,"context_line":"                                            \"IPWrapper\")"},{"line_number":235,"context_line":"        self.mock_ip_wrapper \u003d self.mock_ip_wrapper_p.start()"},{"line_number":236,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"da85f559_b6e1cd9c","line":233,"in_reply_to":"da85f559_1ccb1d74","updated":"2015-11-13 15:53:45.000000000","message":"I think it doesn\u0027t really matter and was done just to look similar with the code above.","commit_id":"32cc08cf34ab8da935e29a782c115f4cf3379ec3"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"29290365ff24edc4c103f99848403843128fb9e8","unresolved":false,"context_lines":[{"line_number":232,"context_line":""},{"line_number":233,"context_line":"        self.mock_ip_wrapper_p \u003d mock.patch(\"neutron.agent.linux.ip_lib.\""},{"line_number":234,"context_line":"                                            \"IPWrapper\")"},{"line_number":235,"context_line":"        self.mock_ip_wrapper \u003d self.mock_ip_wrapper_p.start()"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"    def test_init_host(self):"},{"line_number":238,"context_line":"        dhcp \u003d dhcp_agent.DhcpAgent(HOSTNAME)"}],"source_content_type":"text/x-python","patch_set":13,"id":"da85f559_7ca029a6","line":235,"updated":"2015-11-13 12:54:59.000000000","message":"ditto","commit_id":"32cc08cf34ab8da935e29a782c115f4cf3379ec3"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"29290365ff24edc4c103f99848403843128fb9e8","unresolved":false,"context_lines":[{"line_number":1221,"context_line":"        self.mangle_inst \u003d mock.Mock()"},{"line_number":1222,"context_line":"        self.iptables_inst.ipv4 \u003d {\u0027mangle\u0027: self.mangle_inst}"},{"line_number":1223,"context_line":""},{"line_number":1224,"context_line":"        self.mock_ip_wrapper_p \u003d mock.patch(\"neutron.agent.linux.ip_lib.\""},{"line_number":1225,"context_line":"                                            \"IPWrapper\")"},{"line_number":1226,"context_line":"        self.mock_ip_wrapper \u003d self.mock_ip_wrapper_p.start()"},{"line_number":1227,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"da85f559_5c868514","line":1224,"updated":"2015-11-13 12:54:59.000000000","message":"ditto","commit_id":"32cc08cf34ab8da935e29a782c115f4cf3379ec3"}]}
