)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"9b8b42b9108f986db0c36e7dcaaba02596b74356","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Sylvain Afchain \u003csylvain.afchain@enovance.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2013-12-30 11:57:10 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add param and iptables rules to protect dnsmasq ports"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add a param to the configuration file of the dhcp"},{"line_number":10,"context_line":"agent. With this new param set as true, iptables rules"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"AAAAUH%2F%2F9QI%3D","line":7,"updated":"2014-01-06 08:37:49.000000000","message":"Using the full \u0027parameter\u0027 word won\u0027t raise significantly openstack\u0027s carbon footprint!","commit_id":"2c389dc967d14f4281ffa2ddce16627fd98ce85d"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"68986821c688674a88f27a6c2226e987bae5f8ee","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Sylvain Afchain \u003csylvain.afchain@enovance.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2013-12-30 11:57:10 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add param and iptables rules to protect dnsmasq ports"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add a param to the configuration file of the dhcp"},{"line_number":10,"context_line":"agent. With this new param set as true, iptables rules"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"AAAAUH%2F%2F8tc%3D","line":7,"in_reply_to":"AAAAUH%2F%2F9QI%3D","updated":"2014-01-07 14:40:55.000000000","message":"Yes ;)","commit_id":"2c389dc967d14f4281ffa2ddce16627fd98ce85d"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"9b8b42b9108f986db0c36e7dcaaba02596b74356","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Add a param to the configuration file of the dhcp"},{"line_number":10,"context_line":"agent. With this new param set as true, iptables rules"},{"line_number":11,"context_line":"are inserted to limit dns requests to dnsmasq only to"},{"line_number":12,"context_line":"the client which are on the same subnet."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Iac3635326cb81d5de51b903510ff31cb6164aa86"},{"line_number":15,"context_line":"Closes-bug: #1260731"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"AAAAUH%2F%2F9P8%3D","line":12,"updated":"2014-01-06 08:37:49.000000000","message":"\u0027clients\u0027?","commit_id":"2c389dc967d14f4281ffa2ddce16627fd98ce85d"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"68986821c688674a88f27a6c2226e987bae5f8ee","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Add a param to the configuration file of the dhcp"},{"line_number":10,"context_line":"agent. With this new param set as true, iptables rules"},{"line_number":11,"context_line":"are inserted to limit dns requests to dnsmasq only to"},{"line_number":12,"context_line":"the client which are on the same subnet."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Iac3635326cb81d5de51b903510ff31cb6164aa86"},{"line_number":15,"context_line":"Closes-bug: #1260731"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"AAAAUH%2F%2F8tU%3D","line":12,"in_reply_to":"AAAAUH%2F%2F9P8%3D","updated":"2014-01-07 14:40:55.000000000","message":"Done","commit_id":"2c389dc967d14f4281ffa2ddce16627fd98ce85d"}],"etc/dhcp_agent.ini":[{"author":{"_account_id":55,"name":"Édouard Thuleau","email":"ethuleau@juniper.net","username":"ethuleau"},"change_message_id":"b790de6fdf12c03c796c174f5ec95cb04e82373e","unresolved":false,"context_lines":[{"line_number":83,"context_line":"# dhcp_delete_namespaces \u003d False"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"# Protect the dnsmasq port against external requests, useful in the"},{"line_number":86,"context_line":"# case of an external network."},{"line_number":87,"context_line":"# dhcp_enable_isolation \u003d False"}],"source_content_type":"text/x-properties","patch_set":1,"id":"AAAATn%2F9QIQ%3D","line":86,"updated":"2013-12-13 14:09:52.000000000","message":"nit: \u0027useful in the case of the subnet is routed with others to isolate its DNS port only to the subnet clients\u0027","commit_id":"62bdba22dd9cc5a84afe8a3e7cb459675d0595ed"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"eb84a1863bcb37e20e10221b23241aa4341f6260","unresolved":false,"context_lines":[{"line_number":82,"context_line":"# If True, namespaces will be deleted when a dhcp server is disabled."},{"line_number":83,"context_line":"# dhcp_delete_namespaces \u003d False"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"# Limits the dns requests to dnsmasq only to clients which are on its subnet."},{"line_number":86,"context_line":"# Useful when a subnet is routed to another one or in the case of an"},{"line_number":87,"context_line":"# external network."},{"line_number":88,"context_line":"# dhcp_enable_isolation \u003d False"}],"source_content_type":"text/x-properties","patch_set":4,"id":"AAAATn%2F9GVY%3D","line":85,"updated":"2013-12-16 20:00:34.000000000","message":"I am confused, if we have tenant isolation, how can a broadcast message be delivered to the dhcp port?","commit_id":"edc036f5fc00f58dbdc9336c5a9589eff11b2273"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"e4f5fc1ca41af514e16c93a5df5b6c873686f95c","unresolved":false,"context_lines":[{"line_number":82,"context_line":"# If True, namespaces will be deleted when a dhcp server is disabled."},{"line_number":83,"context_line":"# dhcp_delete_namespaces \u003d False"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"# Limits the dns requests to dnsmasq only to clients which are on its subnet."},{"line_number":86,"context_line":"# Useful when a subnet is routed to another one or in the case of an"},{"line_number":87,"context_line":"# external network."},{"line_number":88,"context_line":"# dhcp_enable_isolation \u003d False"}],"source_content_type":"text/x-properties","patch_set":4,"id":"AAAATn%2F8%2F9E%3D","line":85,"in_reply_to":"AAAATn%2F9GAI%3D","updated":"2013-12-17 21:32:09.000000000","message":"Agreed, better with dns_requests_isolation","commit_id":"edc036f5fc00f58dbdc9336c5a9589eff11b2273"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"1bdd814bd582e48205403c3c37e2466495988833","unresolved":false,"context_lines":[{"line_number":82,"context_line":"# If True, namespaces will be deleted when a dhcp server is disabled."},{"line_number":83,"context_line":"# dhcp_delete_namespaces \u003d False"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"# Limits the dns requests to dnsmasq only to clients which are on its subnet."},{"line_number":86,"context_line":"# Useful when a subnet is routed to another one or in the case of an"},{"line_number":87,"context_line":"# external network."},{"line_number":88,"context_line":"# dhcp_enable_isolation \u003d False"}],"source_content_type":"text/x-properties","patch_set":4,"id":"AAAATn%2F9GAI%3D","line":85,"in_reply_to":"AAAATn%2F9GCk%3D","updated":"2013-12-16 21:51:29.000000000","message":"sorry, I misread dns for dhcp and got confused by the name of the config :P Maybe the config name may be improved to something that implies restricting dns requests, e.g. dns_requests_isolation?","commit_id":"edc036f5fc00f58dbdc9336c5a9589eff11b2273"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"6f8231860ee7ae94ce144f40df4aa08be175ad16","unresolved":false,"context_lines":[{"line_number":82,"context_line":"# If True, namespaces will be deleted when a dhcp server is disabled."},{"line_number":83,"context_line":"# dhcp_delete_namespaces \u003d False"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"# Limits the dns requests to dnsmasq only to clients which are on its subnet."},{"line_number":86,"context_line":"# Useful when a subnet is routed to another one or in the case of an"},{"line_number":87,"context_line":"# external network."},{"line_number":88,"context_line":"# dhcp_enable_isolation \u003d False"}],"source_content_type":"text/x-properties","patch_set":4,"id":"AAAATn%2F9GCk%3D","line":85,"in_reply_to":"AAAATn%2F9GVY%3D","updated":"2013-12-16 21:03:13.000000000","message":"Not broadcasts since it\u0027s DNS requests. When a dnsmasq serves a external network, the dhcp agent create a port a this network, so an external client is able to send DNS requests to this dnsmasq. If a dns forwarder is set in the dhcp agent config file (dnsmasq_dns_server), an external client is able to request the dns forwarder hidden by the dnsmasq.","commit_id":"edc036f5fc00f58dbdc9336c5a9589eff11b2273"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"eb84a1863bcb37e20e10221b23241aa4341f6260","unresolved":false,"context_lines":[{"line_number":84,"context_line":""},{"line_number":85,"context_line":"# Limits the dns requests to dnsmasq only to clients which are on its subnet."},{"line_number":86,"context_line":"# Useful when a subnet is routed to another one or in the case of an"},{"line_number":87,"context_line":"# external network."},{"line_number":88,"context_line":"# dhcp_enable_isolation \u003d False"}],"source_content_type":"text/x-properties","patch_set":4,"id":"AAAATn%2F9GVk%3D","line":87,"updated":"2013-12-16 20:00:34.000000000","message":"external networks can\u0027t really have a Neutron dhcp, can they?","commit_id":"edc036f5fc00f58dbdc9336c5a9589eff11b2273"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"e4f5fc1ca41af514e16c93a5df5b6c873686f95c","unresolved":false,"context_lines":[{"line_number":84,"context_line":""},{"line_number":85,"context_line":"# Limits the dns requests to dnsmasq only to clients which are on its subnet."},{"line_number":86,"context_line":"# Useful when a subnet is routed to another one or in the case of an"},{"line_number":87,"context_line":"# external network."},{"line_number":88,"context_line":"# dhcp_enable_isolation \u003d False"}],"source_content_type":"text/x-properties","patch_set":4,"id":"AAAATn%2F8%2F9M%3D","line":87,"in_reply_to":"AAAATn%2F9FyU%3D","updated":"2013-12-17 21:32:09.000000000","message":"Yes It works, by setting a network as external, and with a provider network as well.","commit_id":"edc036f5fc00f58dbdc9336c5a9589eff11b2273"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"1bdd814bd582e48205403c3c37e2466495988833","unresolved":false,"context_lines":[{"line_number":84,"context_line":""},{"line_number":85,"context_line":"# Limits the dns requests to dnsmasq only to clients which are on its subnet."},{"line_number":86,"context_line":"# Useful when a subnet is routed to another one or in the case of an"},{"line_number":87,"context_line":"# external network."},{"line_number":88,"context_line":"# dhcp_enable_isolation \u003d False"}],"source_content_type":"text/x-properties","patch_set":4,"id":"AAAATn%2F9FyU%3D","line":87,"in_reply_to":"AAAATn%2F9GCo%3D","updated":"2013-12-16 21:51:29.000000000","message":"Agreed; that\u0027s not prevented via the API nor policy check, but does that actually work? I trust your experience, but I was under the assumption that external networks\u0027 IP\u0027s are best handled using something like config-drive, because of the possible issues around the choice of br-ex vs br-int to do the wiring.","commit_id":"edc036f5fc00f58dbdc9336c5a9589eff11b2273"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"6f8231860ee7ae94ce144f40df4aa08be175ad16","unresolved":false,"context_lines":[{"line_number":84,"context_line":""},{"line_number":85,"context_line":"# Limits the dns requests to dnsmasq only to clients which are on its subnet."},{"line_number":86,"context_line":"# Useful when a subnet is routed to another one or in the case of an"},{"line_number":87,"context_line":"# external network."},{"line_number":88,"context_line":"# dhcp_enable_isolation \u003d False"}],"source_content_type":"text/x-properties","patch_set":4,"id":"AAAATn%2F9GCo%3D","line":87,"in_reply_to":"AAAATn%2F9GVk%3D","updated":"2013-12-16 21:03:13.000000000","message":"Subnets of an external network can have a dhcp.","commit_id":"edc036f5fc00f58dbdc9336c5a9589eff11b2273"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"66ec74386b33a55a3b9b4a1fae09281b9a406f88","unresolved":false,"context_lines":[{"line_number":85,"context_line":"# Limits the dns requests to dnsmasq only to clients which are on its subnet."},{"line_number":86,"context_line":"# Useful when a subnet is routed to another one or in the case of an"},{"line_number":87,"context_line":"# external network."},{"line_number":88,"context_line":"dns_requests_isolation \u003d False"}],"source_content_type":"text/x-properties","patch_set":6,"id":"AAAAT3%2F%2F7YA%3D","line":88,"updated":"2013-12-27 02:36:04.000000000","message":"In my opinion the code would read better if you named this \u0027isolate_dns_requests\u0027.","commit_id":"0a9c428e613075972a80d6dc92c019ffd35ecb63"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"ce86587153f003830537cff8063e9a648793dc7b","unresolved":false,"context_lines":[{"line_number":85,"context_line":"# Limits the dns requests to dnsmasq only to clients which are on its subnet."},{"line_number":86,"context_line":"# Useful when a subnet is routed to another one or in the case of an"},{"line_number":87,"context_line":"# external network."},{"line_number":88,"context_line":"dns_requests_isolation \u003d False"}],"source_content_type":"text/x-properties","patch_set":6,"id":"AAAAT3%2F%2F6bo%3D","line":88,"in_reply_to":"AAAAT3%2F%2F7YA%3D","updated":"2013-12-27 11:37:47.000000000","message":"Done","commit_id":"0a9c428e613075972a80d6dc92c019ffd35ecb63"}],"neutron/agent/linux/dhcp.py":[{"author":{"_account_id":55,"name":"Édouard Thuleau","email":"ethuleau@juniper.net","username":"ethuleau"},"change_message_id":"b790de6fdf12c03c796c174f5ec95cb04e82373e","unresolved":false,"context_lines":[{"line_number":780,"context_line":""},{"line_number":781,"context_line":"            tables[\u0027filter\u0027].add_rule(\u0027isolation\u0027,"},{"line_number":782,"context_line":"                                      rule, top\u003dTrue)"},{"line_number":783,"context_line":""},{"line_number":784,"context_line":"        im.apply()"},{"line_number":785,"context_line":""},{"line_number":786,"context_line":"    def setup(self, network, reuse_existing\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F9QD4%3D","line":783,"updated":"2013-12-13 14:09:52.000000000","message":"What about DHCP traffic (UDP bootps/bootpc) ?\nYou should authorize it also.","commit_id":"62bdba22dd9cc5a84afe8a3e7cb459675d0595ed"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"d58783aaa099e380519a40d6c752a38eb4ea9546","unresolved":false,"context_lines":[{"line_number":780,"context_line":""},{"line_number":781,"context_line":"            tables[\u0027filter\u0027].add_rule(\u0027isolation\u0027,"},{"line_number":782,"context_line":"                                      rule, top\u003dTrue)"},{"line_number":783,"context_line":""},{"line_number":784,"context_line":"        im.apply()"},{"line_number":785,"context_line":""},{"line_number":786,"context_line":"    def setup(self, network, reuse_existing\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F9P9Q%3D","line":783,"in_reply_to":"AAAATn%2F9QD4%3D","updated":"2013-12-13 15:03:22.000000000","message":"You\u0027re right :)","commit_id":"62bdba22dd9cc5a84afe8a3e7cb459675d0595ed"},{"author":{"_account_id":55,"name":"Édouard Thuleau","email":"ethuleau@juniper.net","username":"ethuleau"},"change_message_id":"b790de6fdf12c03c796c174f5ec95cb04e82373e","unresolved":false,"context_lines":[{"line_number":824,"context_line":""},{"line_number":825,"context_line":"        if self.conf.use_namespaces:"},{"line_number":826,"context_line":"            self._set_default_route(network)"},{"line_number":827,"context_line":"            if self.conf.dhcp_enable_isolation:"},{"line_number":828,"context_line":"                self._apply_isolation(network)"},{"line_number":829,"context_line":""},{"line_number":830,"context_line":"        return interface_name"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F9QDU%3D","line":827,"updated":"2013-12-13 14:09:52.000000000","message":"Only available with use of network namespaces ?","commit_id":"62bdba22dd9cc5a84afe8a3e7cb459675d0595ed"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"d58783aaa099e380519a40d6c752a38eb4ea9546","unresolved":false,"context_lines":[{"line_number":824,"context_line":""},{"line_number":825,"context_line":"        if self.conf.use_namespaces:"},{"line_number":826,"context_line":"            self._set_default_route(network)"},{"line_number":827,"context_line":"            if self.conf.dhcp_enable_isolation:"},{"line_number":828,"context_line":"                self._apply_isolation(network)"},{"line_number":829,"context_line":""},{"line_number":830,"context_line":"        return interface_name"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F9P0Q%3D","line":827,"in_reply_to":"AAAATn%2F9QDU%3D","updated":"2013-12-13 15:03:22.000000000","message":"Not sure that we want to add rules directly on the network nodes for that, thoughts ?","commit_id":"62bdba22dd9cc5a84afe8a3e7cb459675d0595ed"},{"author":{"_account_id":55,"name":"Édouard Thuleau","email":"ethuleau@juniper.net","username":"ethuleau"},"change_message_id":"a1e97f73af51772828701b06a2d04bd5ab69b5e4","unresolved":false,"context_lines":[{"line_number":760,"context_line":"        im.ipv6[\u0027filter\u0027].add_rule(\u0027isolation\u0027,"},{"line_number":761,"context_line":"                                   \u0027-p icmpv6 \u0027"},{"line_number":762,"context_line":"                                   \u0027-j RETURN\u0027,"},{"line_number":763,"context_line":"                                   top\u003dTrue)"},{"line_number":764,"context_line":""},{"line_number":765,"context_line":"        # allow traffic from dns-server and from subnets"},{"line_number":766,"context_line":"        # everything else will be denied"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9Ow8%3D","line":763,"updated":"2013-12-13 18:34:10.000000000","message":"nit: Could you add DHCP, RA filters a the end of the method \u0027_apply_isolation\u0027 to have them on the top of the chain (before other rules) ?","commit_id":"e6d2c95e94b3d80eceab0ce977058a33856e49a7"},{"author":{"_account_id":55,"name":"Édouard Thuleau","email":"ethuleau@juniper.net","username":"ethuleau"},"change_message_id":"d5edd9d905d751c58f8436f187af27a6c771dab4","unresolved":false,"context_lines":[{"line_number":837,"context_line":"        if self.conf.use_namespaces:"},{"line_number":838,"context_line":"            self._set_default_route(network)"},{"line_number":839,"context_line":"            if self.conf.dhcp_enable_isolation:"},{"line_number":840,"context_line":"                self._apply_isolation(network)"},{"line_number":841,"context_line":""},{"line_number":842,"context_line":"        return interface_name"},{"line_number":843,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9OtY%3D","line":840,"updated":"2013-12-13 18:46:35.000000000","message":"(Response to the comment in the patch set #1)\n\nYes, you are right.\nIt\u0027s easy to implement it in an isolated (netns) and dedicated IPAM environment but on a network node which could handle other services (like routing), the rule is too large.\n\nPerhaps we could be more precise with the filter rule and add the IPAM IP as destination IP? In that case we could also enable it outside a network namespace because it will only block traffic destined to the IPAM IP and can cohabit with other services and Neutron subnet IPAM services (one iptables chain for all subnet IPAM services?).","commit_id":"e6d2c95e94b3d80eceab0ce977058a33856e49a7"},{"author":{"_account_id":55,"name":"Édouard Thuleau","email":"ethuleau@juniper.net","username":"ethuleau"},"change_message_id":"8311782d7f90f0ca7e9ad0b09ee9508ea3a48838","unresolved":false,"context_lines":[{"line_number":584,"context_line":"        self.iptables_managers \u003d {}"},{"line_number":585,"context_line":""},{"line_number":586,"context_line":"    def get_or_create(self, namespace, root_helper):"},{"line_number":587,"context_line":"        ns \u003d namespace"},{"line_number":588,"context_line":"        if not ns:"},{"line_number":589,"context_line":"            ns \u003d \u0027none\u0027"},{"line_number":590,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F8%2Bes%3D","line":587,"updated":"2013-12-18 07:51:07.000000000","message":"I think you can use \u0027namespace\u0027 variable name in all the method \u0027get_or_create\u0027","commit_id":"c41c16b9a1f4afe92a0d1e7299122dd6fc11477a"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"92c35875326d5135f95b2fb632f986da07fb8cdb","unresolved":false,"context_lines":[{"line_number":584,"context_line":"        self.iptables_managers \u003d {}"},{"line_number":585,"context_line":""},{"line_number":586,"context_line":"    def get_or_create(self, namespace, root_helper):"},{"line_number":587,"context_line":"        ns \u003d namespace"},{"line_number":588,"context_line":"        if not ns:"},{"line_number":589,"context_line":"            ns \u003d \u0027none\u0027"},{"line_number":590,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F8%2BUg%3D","line":587,"in_reply_to":"AAAATn%2F8%2Bes%3D","updated":"2013-12-18 08:36:03.000000000","message":"Actually no, since ns and namespace couldnt\u0027t have the same value and I use the original value line 595.","commit_id":"c41c16b9a1f4afe92a0d1e7299122dd6fc11477a"},{"author":{"_account_id":55,"name":"Édouard Thuleau","email":"ethuleau@juniper.net","username":"ethuleau"},"change_message_id":"8311782d7f90f0ca7e9ad0b09ee9508ea3a48838","unresolved":false,"context_lines":[{"line_number":764,"context_line":"        if port:"},{"line_number":765,"context_line":"            interface_name \u003d self.get_interface_name(network, port)"},{"line_number":766,"context_line":"        else:"},{"line_number":767,"context_line":"            raise exceptions.NetworkNotFound(net_id\u003dnetwork.id)"},{"line_number":768,"context_line":""},{"line_number":769,"context_line":"        im \u003d DeviceManager.iptables_ns_manager.get(network.namespace)"},{"line_number":770,"context_line":"        if not im:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F8%2Bd8%3D","line":767,"updated":"2013-12-18 07:51:07.000000000","message":"Could you factorize six precedent line with six from line 787 to 792?","commit_id":"c41c16b9a1f4afe92a0d1e7299122dd6fc11477a"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"92c35875326d5135f95b2fb632f986da07fb8cdb","unresolved":false,"context_lines":[{"line_number":764,"context_line":"        if port:"},{"line_number":765,"context_line":"            interface_name \u003d self.get_interface_name(network, port)"},{"line_number":766,"context_line":"        else:"},{"line_number":767,"context_line":"            raise exceptions.NetworkNotFound(net_id\u003dnetwork.id)"},{"line_number":768,"context_line":""},{"line_number":769,"context_line":"        im \u003d DeviceManager.iptables_ns_manager.get(network.namespace)"},{"line_number":770,"context_line":"        if not im:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F8%2BWM%3D","line":767,"in_reply_to":"AAAATn%2F8%2Bd8%3D","updated":"2013-12-18 08:36:03.000000000","message":"Done","commit_id":"c41c16b9a1f4afe92a0d1e7299122dd6fc11477a"},{"author":{"_account_id":55,"name":"Édouard Thuleau","email":"ethuleau@juniper.net","username":"ethuleau"},"change_message_id":"8311782d7f90f0ca7e9ad0b09ee9508ea3a48838","unresolved":false,"context_lines":[{"line_number":867,"context_line":"            self._set_default_route(network)"},{"line_number":868,"context_line":""},{"line_number":869,"context_line":"        if self.conf.dns_requests_isolation:"},{"line_number":870,"context_line":"            self._apply_dns_isolation(network)"},{"line_number":871,"context_line":""},{"line_number":872,"context_line":"        return interface_name"},{"line_number":873,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F8%2Bcw%3D","line":870,"updated":"2013-12-18 07:51:07.000000000","message":"Here the interface name is already knew (from line 830). Could you reuse it instead of recalculate it at line 787 to 792?","commit_id":"c41c16b9a1f4afe92a0d1e7299122dd6fc11477a"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"92c35875326d5135f95b2fb632f986da07fb8cdb","unresolved":false,"context_lines":[{"line_number":867,"context_line":"            self._set_default_route(network)"},{"line_number":868,"context_line":""},{"line_number":869,"context_line":"        if self.conf.dns_requests_isolation:"},{"line_number":870,"context_line":"            self._apply_dns_isolation(network)"},{"line_number":871,"context_line":""},{"line_number":872,"context_line":"        return interface_name"},{"line_number":873,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F8%2BWI%3D","line":870,"in_reply_to":"AAAATn%2F8%2Bcw%3D","updated":"2013-12-18 08:36:03.000000000","message":"Done","commit_id":"c41c16b9a1f4afe92a0d1e7299122dd6fc11477a"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"66ec74386b33a55a3b9b4a1fae09281b9a406f88","unresolved":false,"context_lines":[{"line_number":579,"context_line":"            sock.close()"},{"line_number":580,"context_line":""},{"line_number":581,"context_line":""},{"line_number":582,"context_line":"class IptablesNamespaceManager(object):"},{"line_number":583,"context_line":"    def __init__(self):"},{"line_number":584,"context_line":"        self.iptables_managers \u003d {}"},{"line_number":585,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAT3%2F%2F7Xg%3D","line":582,"updated":"2013-12-27 02:36:04.000000000","message":"The name implies that this class is a \u0027manager\u0027 or some kind, but it is a cache of iptables managers for namespaces. Consider naming it NamespaceIptablesManagerCache.\n\nI see that managers are never deleted from this cache. As far as I can tell with the current usage it\u0027s not a problem. But it feels a little risky in that a create or get could occur for a deleted namespace, and because of this cache a manager would be returned.\n\nPlease add unit tests for the methods in this class.","commit_id":"0a9c428e613075972a80d6dc92c019ffd35ecb63"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"ce86587153f003830537cff8063e9a648793dc7b","unresolved":false,"context_lines":[{"line_number":579,"context_line":"            sock.close()"},{"line_number":580,"context_line":""},{"line_number":581,"context_line":""},{"line_number":582,"context_line":"class IptablesNamespaceManager(object):"},{"line_number":583,"context_line":"    def __init__(self):"},{"line_number":584,"context_line":"        self.iptables_managers \u003d {}"},{"line_number":585,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAT3%2F%2F6bc%3D","line":582,"in_reply_to":"AAAAT3%2F%2F7Xg%3D","updated":"2013-12-27 11:37:47.000000000","message":"Done","commit_id":"0a9c428e613075972a80d6dc92c019ffd35ecb63"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"66ec74386b33a55a3b9b4a1fae09281b9a406f88","unresolved":false,"context_lines":[{"line_number":586,"context_line":"    def get_or_create(self, namespace, root_helper):"},{"line_number":587,"context_line":"        ns \u003d namespace"},{"line_number":588,"context_line":"        if not ns:"},{"line_number":589,"context_line":"            ns \u003d \u0027none\u0027"},{"line_number":590,"context_line":""},{"line_number":591,"context_line":"        im \u003d self.iptables_managers.get(ns)"},{"line_number":592,"context_line":"        if not im:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAT3%2F%2F7XI%3D","line":589,"updated":"2013-12-27 02:36:04.000000000","message":"You could replace 586-589 with:\n\n    ns \u003d namespace or \u0027none\u0027","commit_id":"0a9c428e613075972a80d6dc92c019ffd35ecb63"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"ce86587153f003830537cff8063e9a648793dc7b","unresolved":false,"context_lines":[{"line_number":586,"context_line":"    def get_or_create(self, namespace, root_helper):"},{"line_number":587,"context_line":"        ns \u003d namespace"},{"line_number":588,"context_line":"        if not ns:"},{"line_number":589,"context_line":"            ns \u003d \u0027none\u0027"},{"line_number":590,"context_line":""},{"line_number":591,"context_line":"        im \u003d self.iptables_managers.get(ns)"},{"line_number":592,"context_line":"        if not im:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAT3%2F%2F6bQ%3D","line":589,"in_reply_to":"AAAAT3%2F%2F7XI%3D","updated":"2013-12-27 11:37:47.000000000","message":"Done","commit_id":"0a9c428e613075972a80d6dc92c019ffd35ecb63"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"66ec74386b33a55a3b9b4a1fae09281b9a406f88","unresolved":false,"context_lines":[{"line_number":599,"context_line":""},{"line_number":600,"context_line":"    def get(self, namespace):"},{"line_number":601,"context_line":"        if not namespace:"},{"line_number":602,"context_line":"            namespace \u003d \u0027none\u0027"},{"line_number":603,"context_line":""},{"line_number":604,"context_line":"        return self.iptables_managers.get(namespace)"},{"line_number":605,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAT3%2F%2F7Wg%3D","line":602,"updated":"2013-12-27 02:36:04.000000000","message":"You could remove 601-603, then below call ...get(namespace or \u0027none\u0027).","commit_id":"0a9c428e613075972a80d6dc92c019ffd35ecb63"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"ce86587153f003830537cff8063e9a648793dc7b","unresolved":false,"context_lines":[{"line_number":599,"context_line":""},{"line_number":600,"context_line":"    def get(self, namespace):"},{"line_number":601,"context_line":"        if not namespace:"},{"line_number":602,"context_line":"            namespace \u003d \u0027none\u0027"},{"line_number":603,"context_line":""},{"line_number":604,"context_line":"        return self.iptables_managers.get(namespace)"},{"line_number":605,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAT3%2F%2F6a8%3D","line":602,"in_reply_to":"AAAAT3%2F%2F7Wg%3D","updated":"2013-12-27 11:37:47.000000000","message":"Done","commit_id":"0a9c428e613075972a80d6dc92c019ffd35ecb63"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"66ec74386b33a55a3b9b4a1fae09281b9a406f88","unresolved":false,"context_lines":[{"line_number":757,"context_line":"        if port:"},{"line_number":758,"context_line":"            interface_name \u003d self.get_interface_name(network, port)"},{"line_number":759,"context_line":"        else:"},{"line_number":760,"context_line":"            raise exceptions.NetworkNotFound(net_id\u003dnetwork.id)"},{"line_number":761,"context_line":""},{"line_number":762,"context_line":"        return interface_name"},{"line_number":763,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAT3%2F%2F7Q4%3D","line":760,"updated":"2013-12-27 02:36:04.000000000","message":"This could be misleading. The real error is that the agent failed to return the DHCP port for the network, and there may be more info about the problem in the agent logs.\n\n(Also, I don\u0027t see this path covered in the unit tests?)","commit_id":"0a9c428e613075972a80d6dc92c019ffd35ecb63"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"ce86587153f003830537cff8063e9a648793dc7b","unresolved":false,"context_lines":[{"line_number":757,"context_line":"        if port:"},{"line_number":758,"context_line":"            interface_name \u003d self.get_interface_name(network, port)"},{"line_number":759,"context_line":"        else:"},{"line_number":760,"context_line":"            raise exceptions.NetworkNotFound(net_id\u003dnetwork.id)"},{"line_number":761,"context_line":""},{"line_number":762,"context_line":"        return interface_name"},{"line_number":763,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAT3%2F%2F6VQ%3D","line":760,"in_reply_to":"AAAAT3%2F%2F7Q4%3D","updated":"2013-12-27 11:37:47.000000000","message":"Done","commit_id":"0a9c428e613075972a80d6dc92c019ffd35ecb63"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"66ec74386b33a55a3b9b4a1fae09281b9a406f88","unresolved":false,"context_lines":[{"line_number":761,"context_line":""},{"line_number":762,"context_line":"        return interface_name"},{"line_number":763,"context_line":""},{"line_number":764,"context_line":"    def _get_isolation_rule(self, proto, chain, interface):"},{"line_number":765,"context_line":"        return (\u0027-p %(proto)s -m %(proto)s \u0027"},{"line_number":766,"context_line":"                \u0027--dport 53 -i %(interface)s \u0027"},{"line_number":767,"context_line":"                \u0027-j $%(chain)s\u0027) % {\u0027proto\u0027: proto,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAT3%2F%2F7Yk%3D","line":764,"updated":"2013-12-27 02:36:04.000000000","message":"Can be @staticmethod ?","commit_id":"0a9c428e613075972a80d6dc92c019ffd35ecb63"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"ce86587153f003830537cff8063e9a648793dc7b","unresolved":false,"context_lines":[{"line_number":761,"context_line":""},{"line_number":762,"context_line":"        return interface_name"},{"line_number":763,"context_line":""},{"line_number":764,"context_line":"    def _get_isolation_rule(self, proto, chain, interface):"},{"line_number":765,"context_line":"        return (\u0027-p %(proto)s -m %(proto)s \u0027"},{"line_number":766,"context_line":"                \u0027--dport 53 -i %(interface)s \u0027"},{"line_number":767,"context_line":"                \u0027-j $%(chain)s\u0027) % {\u0027proto\u0027: proto,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAT3%2F%2F6Zw%3D","line":764,"in_reply_to":"AAAAT3%2F%2F7Yk%3D","updated":"2013-12-27 11:37:47.000000000","message":"Done","commit_id":"0a9c428e613075972a80d6dc92c019ffd35ecb63"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"66ec74386b33a55a3b9b4a1fae09281b9a406f88","unresolved":false,"context_lines":[{"line_number":773,"context_line":""},{"line_number":774,"context_line":"        im \u003d DeviceManager.iptables_ns_manager.get(network.namespace)"},{"line_number":775,"context_line":"        if not im:"},{"line_number":776,"context_line":"            return"},{"line_number":777,"context_line":""},{"line_number":778,"context_line":"        rules_chain \u003d iptables_manager.get_chain_name("},{"line_number":779,"context_line":"            \"dns-\" + network.id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAT3%2F%2F7H4%3D","line":776,"updated":"2013-12-27 02:36:04.000000000","message":"If this happens the isolation is not removed. Shouldn\u0027t you raise an exception or log something? Please cover this path in the unit tests.","commit_id":"0a9c428e613075972a80d6dc92c019ffd35ecb63"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"ce86587153f003830537cff8063e9a648793dc7b","unresolved":false,"context_lines":[{"line_number":773,"context_line":""},{"line_number":774,"context_line":"        im \u003d DeviceManager.iptables_ns_manager.get(network.namespace)"},{"line_number":775,"context_line":"        if not im:"},{"line_number":776,"context_line":"            return"},{"line_number":777,"context_line":""},{"line_number":778,"context_line":"        rules_chain \u003d iptables_manager.get_chain_name("},{"line_number":779,"context_line":"            \"dns-\" + network.id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAT3%2F%2F6VM%3D","line":776,"in_reply_to":"AAAAT3%2F%2F7H4%3D","updated":"2013-12-27 11:37:47.000000000","message":"Done","commit_id":"0a9c428e613075972a80d6dc92c019ffd35ecb63"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"66ec74386b33a55a3b9b4a1fae09281b9a406f88","unresolved":false,"context_lines":[{"line_number":795,"context_line":"        im \u003d DeviceManager.iptables_ns_manager.get_or_create(network.namespace,"},{"line_number":796,"context_line":"                                                             self.root_helper)"},{"line_number":797,"context_line":"        if not im:"},{"line_number":798,"context_line":"            return"},{"line_number":799,"context_line":""},{"line_number":800,"context_line":"        rules_chain \u003d iptables_manager.get_chain_name("},{"line_number":801,"context_line":"            \"dns-\" + network.id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAT3%2F%2F7H0%3D","line":798,"updated":"2013-12-27 02:36:04.000000000","message":"If this happens the isolation is not applied. Shouldn\u0027t you raise an exception or log something?  Please cover this path in the unit tests.","commit_id":"0a9c428e613075972a80d6dc92c019ffd35ecb63"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"ce86587153f003830537cff8063e9a648793dc7b","unresolved":false,"context_lines":[{"line_number":795,"context_line":"        im \u003d DeviceManager.iptables_ns_manager.get_or_create(network.namespace,"},{"line_number":796,"context_line":"                                                             self.root_helper)"},{"line_number":797,"context_line":"        if not im:"},{"line_number":798,"context_line":"            return"},{"line_number":799,"context_line":""},{"line_number":800,"context_line":"        rules_chain \u003d iptables_manager.get_chain_name("},{"line_number":801,"context_line":"            \"dns-\" + network.id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAT3%2F%2F6VE%3D","line":798,"in_reply_to":"AAAAT3%2F%2F7H0%3D","updated":"2013-12-27 11:37:47.000000000","message":"Done","commit_id":"0a9c428e613075972a80d6dc92c019ffd35ecb63"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"66ec74386b33a55a3b9b4a1fae09281b9a406f88","unresolved":false,"context_lines":[{"line_number":811,"context_line":"                tables[\u0027filter\u0027].add_rule(\u0027INPUT\u0027, rule)"},{"line_number":812,"context_line":""},{"line_number":813,"context_line":"        # allow traffic from subnets everything else will be denied"},{"line_number":814,"context_line":"        for i, subnet in enumerate(network.subnets):"},{"line_number":815,"context_line":"            if not subnet.enable_dhcp:"},{"line_number":816,"context_line":"                continue"},{"line_number":817,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAT3%2F%2F7QE%3D","line":814,"updated":"2013-12-27 02:36:04.000000000","message":"enumeration not needed, just\n\n    for subnet in network.subnets:","commit_id":"0a9c428e613075972a80d6dc92c019ffd35ecb63"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"ce86587153f003830537cff8063e9a648793dc7b","unresolved":false,"context_lines":[{"line_number":811,"context_line":"                tables[\u0027filter\u0027].add_rule(\u0027INPUT\u0027, rule)"},{"line_number":812,"context_line":""},{"line_number":813,"context_line":"        # allow traffic from subnets everything else will be denied"},{"line_number":814,"context_line":"        for i, subnet in enumerate(network.subnets):"},{"line_number":815,"context_line":"            if not subnet.enable_dhcp:"},{"line_number":816,"context_line":"                continue"},{"line_number":817,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAT3%2F%2F6Y8%3D","line":814,"in_reply_to":"AAAAT3%2F%2F7QE%3D","updated":"2013-12-27 11:37:47.000000000","message":"Done","commit_id":"0a9c428e613075972a80d6dc92c019ffd35ecb63"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"66ec74386b33a55a3b9b4a1fae09281b9a406f88","unresolved":false,"context_lines":[{"line_number":817,"context_line":""},{"line_number":818,"context_line":"            tables \u003d im.ipv4"},{"line_number":819,"context_line":"            if subnet.ip_version !\u003d 4:"},{"line_number":820,"context_line":"                tables \u003d im.ipv6"},{"line_number":821,"context_line":""},{"line_number":822,"context_line":"            rule \u003d \u0027-s \u0027 + subnet.cidr + \u0027 -j RETURN\u0027"},{"line_number":823,"context_line":"            tables[\u0027filter\u0027].add_rule(rules_chain,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAT3%2F%2F7HM%3D","line":820,"updated":"2013-12-27 02:36:04.000000000","message":"Please add a unit test for ipv6.","commit_id":"0a9c428e613075972a80d6dc92c019ffd35ecb63"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"ce86587153f003830537cff8063e9a648793dc7b","unresolved":false,"context_lines":[{"line_number":817,"context_line":""},{"line_number":818,"context_line":"            tables \u003d im.ipv4"},{"line_number":819,"context_line":"            if subnet.ip_version !\u003d 4:"},{"line_number":820,"context_line":"                tables \u003d im.ipv6"},{"line_number":821,"context_line":""},{"line_number":822,"context_line":"            rule \u003d \u0027-s \u0027 + subnet.cidr + \u0027 -j RETURN\u0027"},{"line_number":823,"context_line":"            tables[\u0027filter\u0027].add_rule(rules_chain,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAT3%2F%2F6Hg%3D","line":820,"in_reply_to":"AAAAT3%2F%2F7HM%3D","updated":"2013-12-27 11:37:47.000000000","message":"Done","commit_id":"0a9c428e613075972a80d6dc92c019ffd35ecb63"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"32d80cba35f57280361e8548e88e5eaa2be990ce","unresolved":false,"context_lines":[{"line_number":63,"context_line":"               help\u003d_(\"The driver used to manage the virtual interface.\")),"},{"line_number":64,"context_line":"    cfg.BoolOpt(\u0027isolate_dns_requests\u0027, default\u003dFalse,"},{"line_number":65,"context_line":"                help\u003d_(\"Limits the dns requests to dnsmasq only to \""},{"line_number":66,"context_line":"                       \"clients which are on its subnet.\")),"},{"line_number":67,"context_line":"]"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"IPV4 \u003d 4"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAT3%2F%2F5bM%3D","line":66,"updated":"2013-12-27 17:17:30.000000000","message":"English grammar nit: This is a little clumsy because of the double \u0027to\u0027. My best attempt at an alternative is \"Allow dns requests to dnsmasq only from clients on its subnet.\"","commit_id":"79d58d6a7927f9605b22930dfce42d66e32f5981"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"32d80cba35f57280361e8548e88e5eaa2be990ce","unresolved":false,"context_lines":[{"line_number":770,"context_line":"        im \u003d DeviceManager.iptables_ns_manager.get(network.namespace)"},{"line_number":771,"context_line":"        if not im:"},{"line_number":772,"context_line":"            LOG.error(_(\"Error unable get the iptables manager created \""},{"line_number":773,"context_line":"                        \"for the network %s\"), network.id)"},{"line_number":774,"context_line":"            return"},{"line_number":775,"context_line":""},{"line_number":776,"context_line":"        rules_chain \u003d iptables_manager.get_chain_name("}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAT3%2F%2F5a8%3D","line":773,"updated":"2013-12-27 17:17:30.000000000","message":"\u0027for the network\u0027  --\u003e  \u0027for network\u0027","commit_id":"79d58d6a7927f9605b22930dfce42d66e32f5981"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"32d80cba35f57280361e8548e88e5eaa2be990ce","unresolved":false,"context_lines":[{"line_number":794,"context_line":"                                                             self.root_helper)"},{"line_number":795,"context_line":"        if not im:"},{"line_number":796,"context_line":"            LOG.error(_(\"Error unable to create or get an iptables manager \""},{"line_number":797,"context_line":"                        \"for the network %s\"), network.id)"},{"line_number":798,"context_line":"            return"},{"line_number":799,"context_line":""},{"line_number":800,"context_line":"        rules_chain \u003d iptables_manager.get_chain_name("}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAT3%2F%2F5a4%3D","line":797,"updated":"2013-12-27 17:17:30.000000000","message":"\u0027for the network\u0027  --\u003e  \u0027for network\u0027","commit_id":"79d58d6a7927f9605b22930dfce42d66e32f5981"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"9b8b42b9108f986db0c36e7dcaaba02596b74356","unresolved":false,"context_lines":[{"line_number":748,"context_line":""},{"line_number":749,"context_line":"    def _get_interface_name_from_network(self, network):"},{"line_number":750,"context_line":"        device_id \u003d self.get_device_id(network)"},{"line_number":751,"context_line":"        port \u003d self.plugin.get_dhcp_port(network.id, device_id)"},{"line_number":752,"context_line":"        if port:"},{"line_number":753,"context_line":"            interface_name \u003d self.get_interface_name(network, port)"},{"line_number":754,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2F9MY%3D","line":751,"updated":"2014-01-06 08:37:49.000000000","message":"This RPC call might end up creating the DHCP port if none can be found.\nStrangely, it seems to me that it would create the port even if DHCP is disabled.\n\nI would prefer, if possible, to either store the interface name in the network info cache for the dhcp agent or somewhere else when the dhcp namespace is setup rather than asking for it to the plugin","commit_id":"2c389dc967d14f4281ffa2ddce16627fd98ce85d"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"68986821c688674a88f27a6c2226e987bae5f8ee","unresolved":false,"context_lines":[{"line_number":748,"context_line":""},{"line_number":749,"context_line":"    def _get_interface_name_from_network(self, network):"},{"line_number":750,"context_line":"        device_id \u003d self.get_device_id(network)"},{"line_number":751,"context_line":"        port \u003d self.plugin.get_dhcp_port(network.id, device_id)"},{"line_number":752,"context_line":"        if port:"},{"line_number":753,"context_line":"            interface_name \u003d self.get_interface_name(network, port)"},{"line_number":754,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2F8sw%3D","line":751,"in_reply_to":"AAAAUH%2F%2F9MY%3D","updated":"2014-01-07 14:40:55.000000000","message":"You\u0027re right, I will change that","commit_id":"2c389dc967d14f4281ffa2ddce16627fd98ce85d"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"9b8b42b9108f986db0c36e7dcaaba02596b74356","unresolved":false,"context_lines":[{"line_number":765,"context_line":"                                    \u0027interface\u0027: interface}"},{"line_number":766,"context_line":""},{"line_number":767,"context_line":"    def _remove_dns_isolation(self, network):"},{"line_number":768,"context_line":"        interface_name \u003d self._get_interface_name_from_network(network)"},{"line_number":769,"context_line":""},{"line_number":770,"context_line":"        im \u003d DeviceManager.iptables_ns_manager.get(network.namespace)"},{"line_number":771,"context_line":"        if not im:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2F9MA%3D","line":768,"updated":"2014-01-06 08:37:49.000000000","message":"In particular, in this case removal of dns isolation, which occurs when the dhcp is deallocated, might trigger creation of a dhcp port.","commit_id":"2c389dc967d14f4281ffa2ddce16627fd98ce85d"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"122750b60cc790d164c39f57318555a4ae508fdf","unresolved":false,"context_lines":[{"line_number":591,"context_line":"            im \u003d iptables_manager.IptablesManager("},{"line_number":592,"context_line":"                root_helper\u003droot_helper,"},{"line_number":593,"context_line":"                namespace\u003dnamespace)"},{"line_number":594,"context_line":"            self.iptables_managers[ns] \u003d im"},{"line_number":595,"context_line":""},{"line_number":596,"context_line":"        return im"},{"line_number":597,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2F2lM%3D","line":594,"updated":"2014-01-07 16:59:01.000000000","message":"As discussed on IRC, please add a cleanup to remove entries when namespaces are removed.","commit_id":"92260d1e9e91afd440622d54094ad6eff38e2136"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"603ec1f817564cdca3ee0f74e52638c6f3ccf7cc","unresolved":false,"context_lines":[{"line_number":761,"context_line":""},{"line_number":762,"context_line":"        return dhcp_port"},{"line_number":763,"context_line":""},{"line_number":764,"context_line":"    def _get_interface_name_from_network(self, network):"},{"line_number":765,"context_line":"        device_id \u003d self.get_device_id(network)"},{"line_number":766,"context_line":"        port \u003d self.plugin.get_dhcp_port(network.id, device_id)"},{"line_number":767,"context_line":"        if port:"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUH%2F%2F0jc%3D","line":764,"updated":"2014-01-08 03:20:40.000000000","message":"this function should be removed since no longer used.","commit_id":"f284ec5ccccd5843cc296336af8fdf79fbc4e67f"},{"author":{"_account_id":55,"name":"Édouard Thuleau","email":"ethuleau@juniper.net","username":"ethuleau"},"change_message_id":"9f6a21889a939a6d27f238f9b223aea03cd8367f","unresolved":false,"context_lines":[{"line_number":761,"context_line":""},{"line_number":762,"context_line":"        return dhcp_port"},{"line_number":763,"context_line":""},{"line_number":764,"context_line":"    def _get_interface_name_from_network(self, network):"},{"line_number":765,"context_line":"        device_id \u003d self.get_device_id(network)"},{"line_number":766,"context_line":"        port \u003d self.plugin.get_dhcp_port(network.id, device_id)"},{"line_number":767,"context_line":"        if port:"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUH%2F%2FzsY%3D","line":764,"in_reply_to":"AAAAUH%2F%2F0jc%3D","updated":"2014-01-08 08:05:41.000000000","message":"agree","commit_id":"f284ec5ccccd5843cc296336af8fdf79fbc4e67f"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"a26cb6fee959294ac50fce6d0c13b7c4b3bd2e56","unresolved":false,"context_lines":[{"line_number":761,"context_line":""},{"line_number":762,"context_line":"        return dhcp_port"},{"line_number":763,"context_line":""},{"line_number":764,"context_line":"    def _get_interface_name_from_network(self, network):"},{"line_number":765,"context_line":"        device_id \u003d self.get_device_id(network)"},{"line_number":766,"context_line":"        port \u003d self.plugin.get_dhcp_port(network.id, device_id)"},{"line_number":767,"context_line":"        if port:"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUH%2F%2FzHw%3D","line":764,"in_reply_to":"AAAAUH%2F%2FzsY%3D","updated":"2014-01-08 10:21:34.000000000","message":"Done","commit_id":"f284ec5ccccd5843cc296336af8fdf79fbc4e67f"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"5fd974cd9f182165d61de957eee3d64cfe49d6e3","unresolved":false,"context_lines":[{"line_number":588,"context_line":""},{"line_number":589,"context_line":"        im \u003d self.iptables_managers.get(ns)"},{"line_number":590,"context_line":"        if not im:"},{"line_number":591,"context_line":"            im \u003d iptables_manager.IptablesManager("},{"line_number":592,"context_line":"                root_helper\u003droot_helper,"},{"line_number":593,"context_line":"                namespace\u003dnamespace)"},{"line_number":594,"context_line":"            self.iptables_managers[ns] \u003d im"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F%2FtFQ%3D","line":591,"updated":"2014-01-09 12:05:09.000000000","message":"I think you need to pass use_ipv6\u003dTrue here, or the ipv6 rules will not be applied, see https://github.com/openstack/neutron/blob/88148584f213cc6a510b1f2d54d6b6dffe74c452/neutron/agent/linux/iptables_manager.py#L364","commit_id":"7a0c001785b2fbfae4601158081e4273417322e0"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"31a8944e1755de18bfd0886f543f274f7632f089","unresolved":false,"context_lines":[{"line_number":588,"context_line":""},{"line_number":589,"context_line":"        im \u003d self.iptables_managers.get(ns)"},{"line_number":590,"context_line":"        if not im:"},{"line_number":591,"context_line":"            im \u003d iptables_manager.IptablesManager("},{"line_number":592,"context_line":"                root_helper\u003droot_helper,"},{"line_number":593,"context_line":"                namespace\u003dnamespace)"},{"line_number":594,"context_line":"            self.iptables_managers[ns] \u003d im"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F%2FsmQ%3D","line":591,"in_reply_to":"AAAAUH%2F%2FtFQ%3D","updated":"2014-01-09 14:15:51.000000000","message":"Yes thx","commit_id":"7a0c001785b2fbfae4601158081e4273417322e0"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"5fd974cd9f182165d61de957eee3d64cfe49d6e3","unresolved":false,"context_lines":[{"line_number":603,"context_line":""},{"line_number":604,"context_line":""},{"line_number":605,"context_line":"class DeviceManager(object):"},{"line_number":606,"context_line":"    iptables_ns_manager \u003d NamespaceIptablesManagerCache()"},{"line_number":607,"context_line":""},{"line_number":608,"context_line":"    def __init__(self, conf, root_helper, plugin):"},{"line_number":609,"context_line":"        self.conf \u003d conf"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F%2FtFI%3D","line":606,"updated":"2014-01-09 12:05:09.000000000","message":"Why is iptables_ns_manager a class-level variable instead of instance-level like everything else? Also, it is only needed when self.conf.isolate_dns_requests is True.","commit_id":"7a0c001785b2fbfae4601158081e4273417322e0"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"754ee52d2058b3419ffdd72bbaa64851fa31106c","unresolved":false,"context_lines":[{"line_number":603,"context_line":""},{"line_number":604,"context_line":""},{"line_number":605,"context_line":"class DeviceManager(object):"},{"line_number":606,"context_line":"    iptables_ns_manager \u003d NamespaceIptablesManagerCache()"},{"line_number":607,"context_line":""},{"line_number":608,"context_line":"    def __init__(self, conf, root_helper, plugin):"},{"line_number":609,"context_line":"        self.conf \u003d conf"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F%2FrfQ%3D","line":606,"in_reply_to":"AAAAUH%2F%2Fsk0%3D","updated":"2014-01-09 17:33:35.000000000","message":"Ok, thanks. I wonder why it does it this way instead of just creating and holding onto the driver object.","commit_id":"7a0c001785b2fbfae4601158081e4273417322e0"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"31a8944e1755de18bfd0886f543f274f7632f089","unresolved":false,"context_lines":[{"line_number":603,"context_line":""},{"line_number":604,"context_line":""},{"line_number":605,"context_line":"class DeviceManager(object):"},{"line_number":606,"context_line":"    iptables_ns_manager \u003d NamespaceIptablesManagerCache()"},{"line_number":607,"context_line":""},{"line_number":608,"context_line":"    def __init__(self, conf, root_helper, plugin):"},{"line_number":609,"context_line":"        self.conf \u003d conf"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F%2Fsk0%3D","line":606,"in_reply_to":"AAAAUH%2F%2FtFI%3D","updated":"2014-01-09 14:15:51.000000000","message":"Because Dnsmasq class which instantiates DeviceManager is instantiated on every call_driver\nhttps://github.com/openstack/neutron/blob/88148584f213cc6a510b1f2d54d6b6dffe74c452/neutron/agent/dhcp_agent.py#L122\n, then to keep the same IptablesManager between to different calls I need to add this variable at this level.","commit_id":"7a0c001785b2fbfae4601158081e4273417322e0"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"5fd974cd9f182165d61de957eee3d64cfe49d6e3","unresolved":false,"context_lines":[{"line_number":831,"context_line":""},{"line_number":832,"context_line":"            tables \u003d im.ipv4"},{"line_number":833,"context_line":"            if subnet.ip_version !\u003d 4:"},{"line_number":834,"context_line":"                tables \u003d im.ipv6"},{"line_number":835,"context_line":""},{"line_number":836,"context_line":"            rule \u003d \u0027-s \u0027 + subnet.cidr + \u0027 -j RETURN\u0027"},{"line_number":837,"context_line":"            tables[\u0027filter\u0027].add_rule(rules_chain,"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F%2FtEw%3D","line":834,"updated":"2014-01-09 12:05:09.000000000","message":"suggestion to save 2 lines:\n\ntables \u003d im.ipv4 if subnet.ip_version \u003d\u003d 4 else im.ipv6","commit_id":"7a0c001785b2fbfae4601158081e4273417322e0"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"31a8944e1755de18bfd0886f543f274f7632f089","unresolved":false,"context_lines":[{"line_number":831,"context_line":""},{"line_number":832,"context_line":"            tables \u003d im.ipv4"},{"line_number":833,"context_line":"            if subnet.ip_version !\u003d 4:"},{"line_number":834,"context_line":"                tables \u003d im.ipv6"},{"line_number":835,"context_line":""},{"line_number":836,"context_line":"            rule \u003d \u0027-s \u0027 + subnet.cidr + \u0027 -j RETURN\u0027"},{"line_number":837,"context_line":"            tables[\u0027filter\u0027].add_rule(rules_chain,"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F%2FsmI%3D","line":834,"in_reply_to":"AAAAUH%2F%2FtEw%3D","updated":"2014-01-09 14:15:51.000000000","message":"Done","commit_id":"7a0c001785b2fbfae4601158081e4273417322e0"},{"author":{"_account_id":2711,"name":"Zhang Hua","display_name":"Zhang Hua","email":"joshua.zhang@canonical.com","username":"zhhuabj"},"change_message_id":"873f8f5403a82fc7215e32b5bb59d3481a8296b5","unresolved":false,"context_lines":[{"line_number":765,"context_line":"    @staticmethod"},{"line_number":766,"context_line":"    def _get_isolation_rule(proto, chain, interface):"},{"line_number":767,"context_line":"        return (\u0027-p %(proto)s -m %(proto)s \u0027"},{"line_number":768,"context_line":"                \u0027--dport 53 -i %(interface)s \u0027"},{"line_number":769,"context_line":"                \u0027-j $%(chain)s\u0027) % {\u0027proto\u0027: proto,"},{"line_number":770,"context_line":"                                    \u0027chain\u0027: chain,"},{"line_number":771,"context_line":"                                    \u0027interface\u0027: interface}"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2FgiQ%3D","line":768,"updated":"2014-01-13 07:17:02.000000000","message":"using existing constant DNS_PORT","commit_id":"3fbf2ee202d9d80c4565f2d051991d0ad723eb29"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"889fa95bb939864f3dabff7ca156b68bdd75f814","unresolved":false,"context_lines":[{"line_number":765,"context_line":"    @staticmethod"},{"line_number":766,"context_line":"    def _get_isolation_rule(proto, chain, interface):"},{"line_number":767,"context_line":"        return (\u0027-p %(proto)s -m %(proto)s \u0027"},{"line_number":768,"context_line":"                \u0027--dport 53 -i %(interface)s \u0027"},{"line_number":769,"context_line":"                \u0027-j $%(chain)s\u0027) % {\u0027proto\u0027: proto,"},{"line_number":770,"context_line":"                                    \u0027chain\u0027: chain,"},{"line_number":771,"context_line":"                                    \u0027interface\u0027: interface}"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2FgF4%3D","line":768,"in_reply_to":"AAAAUH%2F%2FgiQ%3D","updated":"2014-01-13 10:00:28.000000000","message":"Done","commit_id":"3fbf2ee202d9d80c4565f2d051991d0ad723eb29"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"493062c52b275027c7261852553eae6c688dcb86","unresolved":false,"context_lines":[{"line_number":773,"context_line":"    def _remove_dns_isolation(self, network):"},{"line_number":774,"context_line":"        interface_name \u003d self.interface_names.get(network.id)"},{"line_number":775,"context_line":"        if not interface_name:"},{"line_number":776,"context_line":"            LOG.error(_(\"Error unable to get interface name for network: %s\"),"},{"line_number":777,"context_line":"                      network.id)"},{"line_number":778,"context_line":"            return"},{"line_number":779,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2Frd8%3D","line":776,"updated":"2014-01-09 17:41:10.000000000","message":"I\u0027m getting this when I delete a network. Ofcourse self.interface_names does not have the network.id because it is a different self object than when setup() was called.","commit_id":"3fbf2ee202d9d80c4565f2d051991d0ad723eb29"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"e724c96198e8139599ad531712d1e9ba8c19952a","unresolved":false,"context_lines":[{"line_number":773,"context_line":"    def _remove_dns_isolation(self, network):"},{"line_number":774,"context_line":"        interface_name \u003d self.interface_names.get(network.id)"},{"line_number":775,"context_line":"        if not interface_name:"},{"line_number":776,"context_line":"            LOG.error(_(\"Error unable to get interface name for network: %s\"),"},{"line_number":777,"context_line":"                      network.id)"},{"line_number":778,"context_line":"            return"},{"line_number":779,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2FofQ%3D","line":776,"in_reply_to":"AAAAUH%2F%2FrZE%3D","updated":"2014-01-10 09:49:51.000000000","message":"Yes good catch, I will fix it","commit_id":"3fbf2ee202d9d80c4565f2d051991d0ad723eb29"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"6cc446d13f07dfe11ebbec280a0e8897a37954b9","unresolved":false,"context_lines":[{"line_number":773,"context_line":"    def _remove_dns_isolation(self, network):"},{"line_number":774,"context_line":"        interface_name \u003d self.interface_names.get(network.id)"},{"line_number":775,"context_line":"        if not interface_name:"},{"line_number":776,"context_line":"            LOG.error(_(\"Error unable to get interface name for network: %s\"),"},{"line_number":777,"context_line":"                      network.id)"},{"line_number":778,"context_line":"            return"},{"line_number":779,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2FrZE%3D","line":776,"in_reply_to":"AAAAUH%2F%2Frd8%3D","updated":"2014-01-09 17:52:45.000000000","message":"Yup, good catch.","commit_id":"3fbf2ee202d9d80c4565f2d051991d0ad723eb29"},{"author":{"_account_id":2711,"name":"Zhang Hua","display_name":"Zhang Hua","email":"joshua.zhang@canonical.com","username":"zhhuabj"},"change_message_id":"873f8f5403a82fc7215e32b5bb59d3481a8296b5","unresolved":false,"context_lines":[{"line_number":787,"context_line":"            \"dns-\" + network.id)"},{"line_number":788,"context_line":""},{"line_number":789,"context_line":"        for tables in [im.ipv4, im.ipv6]:"},{"line_number":790,"context_line":"            for proto in [\u0027udp\u0027, \u0027tcp\u0027]:"},{"line_number":791,"context_line":"                rule \u003d self._get_isolation_rule(proto, rules_chain,"},{"line_number":792,"context_line":"                                                interface_name)"},{"line_number":793,"context_line":"                tables[\u0027filter\u0027].remove_rule(\u0027INPUT\u0027, rule)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2Fgh8%3D","line":790,"updated":"2014-01-13 07:17:02.000000000","message":"ditto","commit_id":"3fbf2ee202d9d80c4565f2d051991d0ad723eb29"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"889fa95bb939864f3dabff7ca156b68bdd75f814","unresolved":false,"context_lines":[{"line_number":787,"context_line":"            \"dns-\" + network.id)"},{"line_number":788,"context_line":""},{"line_number":789,"context_line":"        for tables in [im.ipv4, im.ipv6]:"},{"line_number":790,"context_line":"            for proto in [\u0027udp\u0027, \u0027tcp\u0027]:"},{"line_number":791,"context_line":"                rule \u003d self._get_isolation_rule(proto, rules_chain,"},{"line_number":792,"context_line":"                                                interface_name)"},{"line_number":793,"context_line":"                tables[\u0027filter\u0027].remove_rule(\u0027INPUT\u0027, rule)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2FgFw%3D","line":790,"in_reply_to":"AAAAUH%2F%2Fgh8%3D","updated":"2014-01-13 10:00:28.000000000","message":"Done","commit_id":"3fbf2ee202d9d80c4565f2d051991d0ad723eb29"},{"author":{"_account_id":2711,"name":"Zhang Hua","display_name":"Zhang Hua","email":"joshua.zhang@canonical.com","username":"zhhuabj"},"change_message_id":"873f8f5403a82fc7215e32b5bb59d3481a8296b5","unresolved":false,"context_lines":[{"line_number":813,"context_line":"            return"},{"line_number":814,"context_line":""},{"line_number":815,"context_line":"        rules_chain \u003d iptables_manager.get_chain_name("},{"line_number":816,"context_line":"            \"dns-\" + network.id)"},{"line_number":817,"context_line":""},{"line_number":818,"context_line":"        for tables in [im.ipv4, im.ipv6]:"},{"line_number":819,"context_line":"            tables[\u0027filter\u0027].add_chain(rules_chain)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2Fgh4%3D","line":816,"updated":"2014-01-13 07:17:02.000000000","message":"better to define the constant","commit_id":"3fbf2ee202d9d80c4565f2d051991d0ad723eb29"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"889fa95bb939864f3dabff7ca156b68bdd75f814","unresolved":false,"context_lines":[{"line_number":813,"context_line":"            return"},{"line_number":814,"context_line":""},{"line_number":815,"context_line":"        rules_chain \u003d iptables_manager.get_chain_name("},{"line_number":816,"context_line":"            \"dns-\" + network.id)"},{"line_number":817,"context_line":""},{"line_number":818,"context_line":"        for tables in [im.ipv4, im.ipv6]:"},{"line_number":819,"context_line":"            tables[\u0027filter\u0027].add_chain(rules_chain)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2FgE8%3D","line":816,"in_reply_to":"AAAAUH%2F%2Fgh4%3D","updated":"2014-01-13 10:00:28.000000000","message":"Done","commit_id":"3fbf2ee202d9d80c4565f2d051991d0ad723eb29"},{"author":{"_account_id":2711,"name":"Zhang Hua","display_name":"Zhang Hua","email":"joshua.zhang@canonical.com","username":"zhhuabj"},"change_message_id":"873f8f5403a82fc7215e32b5bb59d3481a8296b5","unresolved":false,"context_lines":[{"line_number":820,"context_line":"            tables[\u0027filter\u0027].empty_chain(rules_chain)"},{"line_number":821,"context_line":"            tables[\u0027filter\u0027].add_rule(rules_chain, \u0027-j DROP\u0027)"},{"line_number":822,"context_line":""},{"line_number":823,"context_line":"            for proto in [\u0027udp\u0027, \u0027tcp\u0027]:"},{"line_number":824,"context_line":"                rule \u003d self._get_isolation_rule(proto, rules_chain,"},{"line_number":825,"context_line":"                                                interface_name)"},{"line_number":826,"context_line":"                tables[\u0027filter\u0027].add_rule(\u0027INPUT\u0027, rule)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2FgiE%3D","line":823,"updated":"2014-01-13 07:17:02.000000000","message":"using existing constant UDP and TCP in this file","commit_id":"3fbf2ee202d9d80c4565f2d051991d0ad723eb29"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"889fa95bb939864f3dabff7ca156b68bdd75f814","unresolved":false,"context_lines":[{"line_number":820,"context_line":"            tables[\u0027filter\u0027].empty_chain(rules_chain)"},{"line_number":821,"context_line":"            tables[\u0027filter\u0027].add_rule(rules_chain, \u0027-j DROP\u0027)"},{"line_number":822,"context_line":""},{"line_number":823,"context_line":"            for proto in [\u0027udp\u0027, \u0027tcp\u0027]:"},{"line_number":824,"context_line":"                rule \u003d self._get_isolation_rule(proto, rules_chain,"},{"line_number":825,"context_line":"                                                interface_name)"},{"line_number":826,"context_line":"                tables[\u0027filter\u0027].add_rule(\u0027INPUT\u0027, rule)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2FgE4%3D","line":823,"in_reply_to":"AAAAUH%2F%2FgiE%3D","updated":"2014-01-13 10:00:28.000000000","message":"Done","commit_id":"3fbf2ee202d9d80c4565f2d051991d0ad723eb29"},{"author":{"_account_id":2711,"name":"Zhang Hua","display_name":"Zhang Hua","email":"joshua.zhang@canonical.com","username":"zhhuabj"},"change_message_id":"873f8f5403a82fc7215e32b5bb59d3481a8296b5","unresolved":false,"context_lines":[{"line_number":830,"context_line":"            if not subnet.enable_dhcp:"},{"line_number":831,"context_line":"                continue"},{"line_number":832,"context_line":""},{"line_number":833,"context_line":"            tables \u003d im.ipv4 if subnet.ip_version \u003d\u003d 4 else im.ipv6"},{"line_number":834,"context_line":""},{"line_number":835,"context_line":"            rule \u003d \u0027-s \u0027 + subnet.cidr + \u0027 -j RETURN\u0027"},{"line_number":836,"context_line":"            tables[\u0027filter\u0027].add_rule(rules_chain,"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2Fghs%3D","line":833,"updated":"2014-01-13 07:17:02.000000000","message":"using existing constant IPV4","commit_id":"3fbf2ee202d9d80c4565f2d051991d0ad723eb29"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"889fa95bb939864f3dabff7ca156b68bdd75f814","unresolved":false,"context_lines":[{"line_number":830,"context_line":"            if not subnet.enable_dhcp:"},{"line_number":831,"context_line":"                continue"},{"line_number":832,"context_line":""},{"line_number":833,"context_line":"            tables \u003d im.ipv4 if subnet.ip_version \u003d\u003d 4 else im.ipv6"},{"line_number":834,"context_line":""},{"line_number":835,"context_line":"            rule \u003d \u0027-s \u0027 + subnet.cidr + \u0027 -j RETURN\u0027"},{"line_number":836,"context_line":"            tables[\u0027filter\u0027].add_rule(rules_chain,"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAUH%2F%2FgE0%3D","line":833,"in_reply_to":"AAAAUH%2F%2Fghs%3D","updated":"2014-01-13 10:00:28.000000000","message":"Done","commit_id":"3fbf2ee202d9d80c4565f2d051991d0ad723eb29"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"1ec76f7c6291efce8b246b97e4a3e4bdbefa8d8e","unresolved":false,"context_lines":[{"line_number":614,"context_line":"    def get(self, network):"},{"line_number":615,"context_line":"        interface_name \u003d self.interface_names.get(network.id)"},{"line_number":616,"context_line":""},{"line_number":617,"context_line":"        return interface_name"},{"line_number":618,"context_line":""},{"line_number":619,"context_line":"    def remove(self, network):"},{"line_number":620,"context_line":"        self.interface_names.pop(network.id, None)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2Fexo%3D","line":617,"updated":"2014-01-13 14:47:26.000000000","message":"Suggest you combine line 615-617.","commit_id":"270c98bf1e2e1d94039c3b0737c31aba65f1eace"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"f3c1b4d99f5cd02a11918f2a68d06cc1dd819693","unresolved":false,"context_lines":[{"line_number":614,"context_line":"    def get(self, network):"},{"line_number":615,"context_line":"        interface_name \u003d self.interface_names.get(network.id)"},{"line_number":616,"context_line":""},{"line_number":617,"context_line":"        return interface_name"},{"line_number":618,"context_line":""},{"line_number":619,"context_line":"    def remove(self, network):"},{"line_number":620,"context_line":"        self.interface_names.pop(network.id, None)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2B%2BRU%3D","line":617,"in_reply_to":"AAAAUH%2F%2Fexo%3D","updated":"2014-01-20 12:04:00.000000000","message":"Done","commit_id":"270c98bf1e2e1d94039c3b0737c31aba65f1eace"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"abc3c8c0ceea21964fe88bf8ce35f0b13bb8094f","unresolved":false,"context_lines":[{"line_number":797,"context_line":"            for proto in [UDP, TCP]:"},{"line_number":798,"context_line":"                rule \u003d self._get_isolation_rule(proto, rules_chain,"},{"line_number":799,"context_line":"                                                interface_name)"},{"line_number":800,"context_line":"                tables[\u0027filter\u0027].remove_rule(\u0027INPUT\u0027, rule)"},{"line_number":801,"context_line":""},{"line_number":802,"context_line":"            tables[\u0027filter\u0027].remove_chain(rules_chain)"},{"line_number":803,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2FeAY%3D","line":800,"updated":"2014-01-13 16:30:48.000000000","message":"I get these warnings when I delete a network:\n\n    2014-01-13 14:46:15.431 4362 WARNING neutron.agent.linux.iptables_manager  Tried to remove rule that was not there: \u0027INPUT\u0027 u\u0027-p udp -m udp --dport 53 -i tap8d9cc840-a9 -j $dns-8b1b72b\u0027 True False\n    2014-01-13 14:46:15.432 4362 WARNING neutron.agent.linux.iptables_manager  Tried to remove rule that was not there: \u0027INPUT\u0027 u\u0027-p tcp -m tcp --dport 53 -i tap8d9cc840-a9 -j $dns-8b1b72b\u0027 True False\n    2014-01-13 14:46:15.433 4362 WARNING neutron.agent.linux.iptables_manager  Tried to remove rule that was not there: \u0027INPUT\u0027 u\u0027-p udp -m udp --dport 53 -i tap8d9cc840-a9 -j $dns-8b1b72b\u0027 True False\n    2014-01-13 14:46:15.434 4362 WARNING neutron.agent.linux.iptables_manager  Tried to remove rule that was not there: \u0027INPUT\u0027 u\u0027-p tcp -m tcp --dport 53 -i tap8d9cc840-a9 -j $dns-8b1b72b\u0027 True False","commit_id":"270c98bf1e2e1d94039c3b0737c31aba65f1eace"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"f3c1b4d99f5cd02a11918f2a68d06cc1dd819693","unresolved":false,"context_lines":[{"line_number":797,"context_line":"            for proto in [UDP, TCP]:"},{"line_number":798,"context_line":"                rule \u003d self._get_isolation_rule(proto, rules_chain,"},{"line_number":799,"context_line":"                                                interface_name)"},{"line_number":800,"context_line":"                tables[\u0027filter\u0027].remove_rule(\u0027INPUT\u0027, rule)"},{"line_number":801,"context_line":""},{"line_number":802,"context_line":"            tables[\u0027filter\u0027].remove_chain(rules_chain)"},{"line_number":803,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2B%2BQ8%3D","line":800,"in_reply_to":"AAAAUH%2F%2FBqg%3D","updated":"2014-01-20 12:04:00.000000000","message":"You\u0027re right, thx","commit_id":"270c98bf1e2e1d94039c3b0737c31aba65f1eace"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"aa4bbb0f8a40e7d61ff561b1abd827cab12d86a0","unresolved":false,"context_lines":[{"line_number":797,"context_line":"            for proto in [UDP, TCP]:"},{"line_number":798,"context_line":"                rule \u003d self._get_isolation_rule(proto, rules_chain,"},{"line_number":799,"context_line":"                                                interface_name)"},{"line_number":800,"context_line":"                tables[\u0027filter\u0027].remove_rule(\u0027INPUT\u0027, rule)"},{"line_number":801,"context_line":""},{"line_number":802,"context_line":"            tables[\u0027filter\u0027].remove_chain(rules_chain)"},{"line_number":803,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2FBqg%3D","line":800,"in_reply_to":"AAAAUH%2F%2FQb8%3D","updated":"2014-01-18 15:51:30.000000000","message":"I don\u0027t think this inner loop to delete the rules is needed. The remove_chain() call on L802 will do that anyway. The docstring is:\n\n    This removal \"cascades\". All rule in the chain are removed, as are\n    all rules in other chains that jump to it.","commit_id":"270c98bf1e2e1d94039c3b0737c31aba65f1eace"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"5b9a3845b4471ed6ea52ff12d0c8ae98c7042172","unresolved":false,"context_lines":[{"line_number":797,"context_line":"            for proto in [UDP, TCP]:"},{"line_number":798,"context_line":"                rule \u003d self._get_isolation_rule(proto, rules_chain,"},{"line_number":799,"context_line":"                                                interface_name)"},{"line_number":800,"context_line":"                tables[\u0027filter\u0027].remove_rule(\u0027INPUT\u0027, rule)"},{"line_number":801,"context_line":""},{"line_number":802,"context_line":"            tables[\u0027filter\u0027].remove_chain(rules_chain)"},{"line_number":803,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2FQb8%3D","line":800,"in_reply_to":"AAAAUH%2F%2FQjg%3D","updated":"2014-01-15 20:05:28.000000000","message":"Yes, I will submit a patch for the iptables_manager issue and will add this one as a dependency.","commit_id":"270c98bf1e2e1d94039c3b0737c31aba65f1eace"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"566993f48007a27344a8a7f2c83aa0b1df26506b","unresolved":false,"context_lines":[{"line_number":797,"context_line":"            for proto in [UDP, TCP]:"},{"line_number":798,"context_line":"                rule \u003d self._get_isolation_rule(proto, rules_chain,"},{"line_number":799,"context_line":"                                                interface_name)"},{"line_number":800,"context_line":"                tables[\u0027filter\u0027].remove_rule(\u0027INPUT\u0027, rule)"},{"line_number":801,"context_line":""},{"line_number":802,"context_line":"            tables[\u0027filter\u0027].remove_chain(rules_chain)"},{"line_number":803,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2FQjg%3D","line":800,"in_reply_to":"AAAAUH%2F%2FSRc%3D","updated":"2014-01-15 19:28:29.000000000","message":"(Missing a \u00279\u0027 at the end of the bug number:  https://bugs.launchpad.net/neutron/+bug/1269189 )\n\nLooks like that bug needs to be fixed before this patch can function correctly?","commit_id":"270c98bf1e2e1d94039c3b0737c31aba65f1eace"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"a89b67fb591c983cf4e48133639e834b8ca69b23","unresolved":false,"context_lines":[{"line_number":797,"context_line":"            for proto in [UDP, TCP]:"},{"line_number":798,"context_line":"                rule \u003d self._get_isolation_rule(proto, rules_chain,"},{"line_number":799,"context_line":"                                                interface_name)"},{"line_number":800,"context_line":"                tables[\u0027filter\u0027].remove_rule(\u0027INPUT\u0027, rule)"},{"line_number":801,"context_line":""},{"line_number":802,"context_line":"            tables[\u0027filter\u0027].remove_chain(rules_chain)"},{"line_number":803,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2FSRc%3D","line":800,"in_reply_to":"AAAAUH%2F%2Fcd4%3D","updated":"2014-01-15 13:49:43.000000000","message":"This issue comes from the iptables_manager which doesn\u0027t manage removing rules correctly. I filled a bug about that : https://bugs.launchpad.net/neutron/+bug/1269189","commit_id":"270c98bf1e2e1d94039c3b0737c31aba65f1eace"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"e0b89f564d1e8268844274e43f24538a42d69b52","unresolved":false,"context_lines":[{"line_number":797,"context_line":"            for proto in [UDP, TCP]:"},{"line_number":798,"context_line":"                rule \u003d self._get_isolation_rule(proto, rules_chain,"},{"line_number":799,"context_line":"                                                interface_name)"},{"line_number":800,"context_line":"                tables[\u0027filter\u0027].remove_rule(\u0027INPUT\u0027, rule)"},{"line_number":801,"context_line":""},{"line_number":802,"context_line":"            tables[\u0027filter\u0027].remove_chain(rules_chain)"},{"line_number":803,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2Fcd4%3D","line":800,"in_reply_to":"AAAAUH%2F%2FeAY%3D","updated":"2014-01-13 20:20:12.000000000","message":"I need to pay more attention. These warnings are in my logs too.","commit_id":"270c98bf1e2e1d94039c3b0737c31aba65f1eace"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"aa4bbb0f8a40e7d61ff561b1abd827cab12d86a0","unresolved":false,"context_lines":[{"line_number":821,"context_line":"            return"},{"line_number":822,"context_line":""},{"line_number":823,"context_line":"        rules_chain \u003d iptables_manager.get_chain_name("},{"line_number":824,"context_line":"            \"dns-\" + network.id)"},{"line_number":825,"context_line":""},{"line_number":826,"context_line":"        for tables in [im.ipv4, im.ipv6]:"},{"line_number":827,"context_line":"            tables[\u0027filter\u0027].add_chain(rules_chain)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2FBqI%3D","line":824,"updated":"2014-01-18 15:51:30.000000000","message":"DNS_CHAIN_PREFIX","commit_id":"270c98bf1e2e1d94039c3b0737c31aba65f1eace"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"f3c1b4d99f5cd02a11918f2a68d06cc1dd819693","unresolved":false,"context_lines":[{"line_number":821,"context_line":"            return"},{"line_number":822,"context_line":""},{"line_number":823,"context_line":"        rules_chain \u003d iptables_manager.get_chain_name("},{"line_number":824,"context_line":"            \"dns-\" + network.id)"},{"line_number":825,"context_line":""},{"line_number":826,"context_line":"        for tables in [im.ipv4, im.ipv6]:"},{"line_number":827,"context_line":"            tables[\u0027filter\u0027].add_chain(rules_chain)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2B%2BOo%3D","line":824,"in_reply_to":"AAAAUH%2F%2FBqI%3D","updated":"2014-01-20 12:04:00.000000000","message":"Done","commit_id":"270c98bf1e2e1d94039c3b0737c31aba65f1eace"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"abc3c8c0ceea21964fe88bf8ce35f0b13bb8094f","unresolved":false,"context_lines":[{"line_number":901,"context_line":"            self._set_default_route(network)"},{"line_number":902,"context_line":""},{"line_number":903,"context_line":"        if self.conf.isolate_dns_requests:"},{"line_number":904,"context_line":"            self._apply_dns_isolation(network)"},{"line_number":905,"context_line":""},{"line_number":906,"context_line":"    def destroy(self, network, device_name):"},{"line_number":907,"context_line":"        \"\"\"Destroy the device used for the network\u0027s DHCP on this host.\"\"\""}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2Fdrs%3D","line":904,"updated":"2014-01-13 16:30:48.000000000","message":"update() gets called every time the dhcp-agent reloads the allocations. So a iptable-save/iptable-restore and ip6table-save/ip6table-restore will be run each time. This quite expensive and will happen frequently.","commit_id":"270c98bf1e2e1d94039c3b0737c31aba65f1eace"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"f3c1b4d99f5cd02a11918f2a68d06cc1dd819693","unresolved":false,"context_lines":[{"line_number":901,"context_line":"            self._set_default_route(network)"},{"line_number":902,"context_line":""},{"line_number":903,"context_line":"        if self.conf.isolate_dns_requests:"},{"line_number":904,"context_line":"            self._apply_dns_isolation(network)"},{"line_number":905,"context_line":""},{"line_number":906,"context_line":"    def destroy(self, network, device_name):"},{"line_number":907,"context_line":"        \"\"\"Destroy the device used for the network\u0027s DHCP on this host.\"\"\""}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2B%2BFo%3D","line":904,"in_reply_to":"AAAAUH%2F%2FBp8%3D","updated":"2014-01-20 12:04:00.000000000","message":"Since the rules depend of subnets I will add something to check if there are some add/remove of subnets for the network.","commit_id":"270c98bf1e2e1d94039c3b0737c31aba65f1eace"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"aa4bbb0f8a40e7d61ff561b1abd827cab12d86a0","unresolved":false,"context_lines":[{"line_number":901,"context_line":"            self._set_default_route(network)"},{"line_number":902,"context_line":""},{"line_number":903,"context_line":"        if self.conf.isolate_dns_requests:"},{"line_number":904,"context_line":"            self._apply_dns_isolation(network)"},{"line_number":905,"context_line":""},{"line_number":906,"context_line":"    def destroy(self, network, device_name):"},{"line_number":907,"context_line":"        \"\"\"Destroy the device used for the network\u0027s DHCP on this host.\"\"\""}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2FBp8%3D","line":904,"in_reply_to":"AAAAUH%2F%2Fdrs%3D","updated":"2014-01-18 15:51:30.000000000","message":"Maybe only call apply() on L847 if the list of rules changes?","commit_id":"270c98bf1e2e1d94039c3b0737c31aba65f1eace"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"0e18d2d37a6415c27a05f44cf5776ec45beff30d","unresolved":false,"context_lines":[{"line_number":601,"context_line":"    def is_up_to_date(self, network):"},{"line_number":602,"context_line":"        subnets \u003d self.subnets.get(network.id)"},{"line_number":603,"context_line":"        if not subnets:"},{"line_number":604,"context_line":"            return False"},{"line_number":605,"context_line":""},{"line_number":606,"context_line":"        csubnets \u003d set([subnet.id for subnet in network.subnets])"},{"line_number":607,"context_line":"        if subnets \u003d\u003d csubnets:"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAUH%2F%2BxDI%3D","line":604,"updated":"2014-01-22 11:19:28.000000000","message":"not sure if 603 and 604 are needed as 607 will work anyway.","commit_id":"6302b23f037bad6f6717b3e81e073feec37bc2d9"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"45d24ed1d4d410c41243c219cf8652b967f2293f","unresolved":false,"context_lines":[{"line_number":601,"context_line":"    def is_up_to_date(self, network):"},{"line_number":602,"context_line":"        subnets \u003d self.subnets.get(network.id)"},{"line_number":603,"context_line":"        if not subnets:"},{"line_number":604,"context_line":"            return False"},{"line_number":605,"context_line":""},{"line_number":606,"context_line":"        csubnets \u003d set([subnet.id for subnet in network.subnets])"},{"line_number":607,"context_line":"        if subnets \u003d\u003d csubnets:"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAUH%2F%2BrV4%3D","line":604,"in_reply_to":"AAAAUH%2F%2BxDI%3D","updated":"2014-01-23 09:53:18.000000000","message":"Done","commit_id":"6302b23f037bad6f6717b3e81e073feec37bc2d9"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"0e18d2d37a6415c27a05f44cf5776ec45beff30d","unresolved":false,"context_lines":[{"line_number":603,"context_line":"        if not subnets:"},{"line_number":604,"context_line":"            return False"},{"line_number":605,"context_line":""},{"line_number":606,"context_line":"        csubnets \u003d set([subnet.id for subnet in network.subnets])"},{"line_number":607,"context_line":"        if subnets \u003d\u003d csubnets:"},{"line_number":608,"context_line":"            return True"},{"line_number":609,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAUH%2F%2BxCQ%3D","line":606,"updated":"2014-01-22 11:19:28.000000000","message":"It took me a moment to work out what the \u0027c\u0027 in csubnets meant - it\u0027s early. I think current_subnets would be better.","commit_id":"6302b23f037bad6f6717b3e81e073feec37bc2d9"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"45d24ed1d4d410c41243c219cf8652b967f2293f","unresolved":false,"context_lines":[{"line_number":603,"context_line":"        if not subnets:"},{"line_number":604,"context_line":"            return False"},{"line_number":605,"context_line":""},{"line_number":606,"context_line":"        csubnets \u003d set([subnet.id for subnet in network.subnets])"},{"line_number":607,"context_line":"        if subnets \u003d\u003d csubnets:"},{"line_number":608,"context_line":"            return True"},{"line_number":609,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAUH%2F%2BrV0%3D","line":606,"in_reply_to":"AAAAUH%2F%2BxCQ%3D","updated":"2014-01-23 09:53:18.000000000","message":"Done","commit_id":"6302b23f037bad6f6717b3e81e073feec37bc2d9"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"341a7731909f4c6612b489f95da08e6cf0f5bc34","unresolved":false,"context_lines":[{"line_number":604,"context_line":"        if subnets \u003d\u003d current_subnets:"},{"line_number":605,"context_line":"            return True"},{"line_number":606,"context_line":""},{"line_number":607,"context_line":"        return False"},{"line_number":608,"context_line":""},{"line_number":609,"context_line":"    def get(self, network):"},{"line_number":610,"context_line":"        return self.iptables_managers.get(network.namespace or \u0027none\u0027)"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAUH%2F%2Bq44%3D","line":607,"updated":"2014-01-23 11:10:59.000000000","message":"you could save a few lines by just doing:\n\n    return subnets \u003d\u003d current_subnets","commit_id":"49348dcb2219c519d0bf9e87834844f2bcf49ec1"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"a36ef3f086b0942bac93e87759339b6836afcddb","unresolved":false,"context_lines":[{"line_number":586,"context_line":"        self.subnets \u003d {}"},{"line_number":587,"context_line":""},{"line_number":588,"context_line":"    def get_or_create(self, network, root_helper):"},{"line_number":589,"context_line":"        ns \u003d network.namespace or \u0027none\u0027"},{"line_number":590,"context_line":""},{"line_number":591,"context_line":"        im \u003d self.iptables_managers.get(ns)"},{"line_number":592,"context_line":"        if not im:"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAUH%2F%2Bbbk%3D","line":589,"updated":"2014-01-26 22:51:26.000000000","message":"any wrong with \u0027ns \u003d network.namespace\u0027?","commit_id":"a9bf33932ae5703f1d36a51e284ee0f509646ffe"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"d9442d7506018f0abb5e262eba7f57dbe44aae1a","unresolved":false,"context_lines":[{"line_number":586,"context_line":"        self.subnets \u003d {}"},{"line_number":587,"context_line":""},{"line_number":588,"context_line":"    def get_or_create(self, network, root_helper):"},{"line_number":589,"context_line":"        ns \u003d network.namespace or \u0027none\u0027"},{"line_number":590,"context_line":""},{"line_number":591,"context_line":"        im \u003d self.iptables_managers.get(ns)"},{"line_number":592,"context_line":"        if not im:"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAUH%2F%2BJXQ%3D","line":589,"in_reply_to":"AAAAUH%2F%2Bbbk%3D","updated":"2014-01-29 18:35:25.000000000","message":"Done","commit_id":"a9bf33932ae5703f1d36a51e284ee0f509646ffe"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"a36ef3f086b0942bac93e87759339b6836afcddb","unresolved":false,"context_lines":[{"line_number":604,"context_line":"        return subnets \u003d\u003d current_subnets"},{"line_number":605,"context_line":""},{"line_number":606,"context_line":"    def get(self, network):"},{"line_number":607,"context_line":"        return self.iptables_managers.get(network.namespace or \u0027none\u0027)"},{"line_number":608,"context_line":""},{"line_number":609,"context_line":"    def remove(self, network):"},{"line_number":610,"context_line":"        self.subnets.pop(network.id, None)"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAUH%2F%2BbcI%3D","line":607,"updated":"2014-01-26 22:51:26.000000000","message":"why get(network.namespace or \u0027none\u0027) instead of get(network.namespace) only?","commit_id":"a9bf33932ae5703f1d36a51e284ee0f509646ffe"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"a36ef3f086b0942bac93e87759339b6836afcddb","unresolved":false,"context_lines":[{"line_number":608,"context_line":""},{"line_number":609,"context_line":"    def remove(self, network):"},{"line_number":610,"context_line":"        self.subnets.pop(network.id, None)"},{"line_number":611,"context_line":"        self.iptables_managers.pop(network.namespace or \u0027none\u0027, None)"},{"line_number":612,"context_line":""},{"line_number":613,"context_line":"    def apply(self, network):"},{"line_number":614,"context_line":"        ns \u003d network.namespace or \u0027none\u0027"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAUH%2F%2BbcA%3D","line":611,"updated":"2014-01-26 22:51:26.000000000","message":"same as above","commit_id":"a9bf33932ae5703f1d36a51e284ee0f509646ffe"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"a36ef3f086b0942bac93e87759339b6836afcddb","unresolved":false,"context_lines":[{"line_number":611,"context_line":"        self.iptables_managers.pop(network.namespace or \u0027none\u0027, None)"},{"line_number":612,"context_line":""},{"line_number":613,"context_line":"    def apply(self, network):"},{"line_number":614,"context_line":"        ns \u003d network.namespace or \u0027none\u0027"},{"line_number":615,"context_line":""},{"line_number":616,"context_line":"        im \u003d self.iptables_managers.get(ns)"},{"line_number":617,"context_line":"        if not im:"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAUH%2F%2Bbb0%3D","line":614,"updated":"2014-01-26 22:51:26.000000000","message":"I think no need for the \u0027or\u0027 expression.","commit_id":"a9bf33932ae5703f1d36a51e284ee0f509646ffe"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"7327c91d3332de271f7c75356cafa13731d98004","unresolved":false,"context_lines":[{"line_number":615,"context_line":""},{"line_number":616,"context_line":"        im \u003d self.iptables_managers.get(ns)"},{"line_number":617,"context_line":"        if not im:"},{"line_number":618,"context_line":"            LOG.error(_(\"apply called on a non existant iptables_manager \""},{"line_number":619,"context_line":"                        \"for network %s, get_or_create has to be called \""},{"line_number":620,"context_line":"                        \"before\"), network.id)"},{"line_number":621,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAUH%2F%2BbfE%3D","line":618,"updated":"2014-01-26 21:43:45.000000000","message":"pedantry: existant -\u003e existent\n\nmore pedantry: LOG.error will eventually trigger gate job failures. If this is not an error which is worth triggering a job failures, consider setting severity to \u0027warn\u0027","commit_id":"a9bf33932ae5703f1d36a51e284ee0f509646ffe"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"d9442d7506018f0abb5e262eba7f57dbe44aae1a","unresolved":false,"context_lines":[{"line_number":615,"context_line":""},{"line_number":616,"context_line":"        im \u003d self.iptables_managers.get(ns)"},{"line_number":617,"context_line":"        if not im:"},{"line_number":618,"context_line":"            LOG.error(_(\"apply called on a non existant iptables_manager \""},{"line_number":619,"context_line":"                        \"for network %s, get_or_create has to be called \""},{"line_number":620,"context_line":"                        \"before\"), network.id)"},{"line_number":621,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAUH%2F%2BJWg%3D","line":618,"in_reply_to":"AAAAUH%2F%2BbfE%3D","updated":"2014-01-29 18:35:25.000000000","message":"Done","commit_id":"a9bf33932ae5703f1d36a51e284ee0f509646ffe"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"7327c91d3332de271f7c75356cafa13731d98004","unresolved":false,"context_lines":[{"line_number":801,"context_line":"        interface_name \u003d DeviceManager.interface_name_cache.get(network)"},{"line_number":802,"context_line":"        if not interface_name:"},{"line_number":803,"context_line":"            LOG.error(_(\"Error unable to get interface name for network: %s\"),"},{"line_number":804,"context_line":"                      network.id)"},{"line_number":805,"context_line":"            return"},{"line_number":806,"context_line":""},{"line_number":807,"context_line":"        im \u003d DeviceManager.iptables_manager_cache.get(network)"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAUH%2F%2BbfA%3D","line":804,"updated":"2014-01-26 21:43:45.000000000","message":"same comment as above about LOG.error.\n\nthe same comment applies to several places throughout this patch.","commit_id":"a9bf33932ae5703f1d36a51e284ee0f509646ffe"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"7327c91d3332de271f7c75356cafa13731d98004","unresolved":false,"context_lines":[{"line_number":844,"context_line":""},{"line_number":845,"context_line":"        for tables in [im.ipv4, im.ipv6]:"},{"line_number":846,"context_line":"            tables[\u0027filter\u0027].add_chain(rules_chain)"},{"line_number":847,"context_line":"            tables[\u0027filter\u0027].empty_chain(rules_chain)"},{"line_number":848,"context_line":"            tables[\u0027filter\u0027].add_rule(rules_chain, \u0027-j DROP\u0027)"},{"line_number":849,"context_line":""},{"line_number":850,"context_line":"            for proto in [UDP, TCP]:"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAUH%2F%2Bbeo%3D","line":847,"updated":"2014-01-26 21:43:45.000000000","message":"I looked at the code to understand why you are doing an empty_chain after the add_chain, and found out that it makes sense. This is a case where you might want to explain what you\u0027re doing with a comment.","commit_id":"a9bf33932ae5703f1d36a51e284ee0f509646ffe"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"d9442d7506018f0abb5e262eba7f57dbe44aae1a","unresolved":false,"context_lines":[{"line_number":844,"context_line":""},{"line_number":845,"context_line":"        for tables in [im.ipv4, im.ipv6]:"},{"line_number":846,"context_line":"            tables[\u0027filter\u0027].add_chain(rules_chain)"},{"line_number":847,"context_line":"            tables[\u0027filter\u0027].empty_chain(rules_chain)"},{"line_number":848,"context_line":"            tables[\u0027filter\u0027].add_rule(rules_chain, \u0027-j DROP\u0027)"},{"line_number":849,"context_line":""},{"line_number":850,"context_line":"            for proto in [UDP, TCP]:"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAUH%2F%2BJPk%3D","line":847,"in_reply_to":"AAAAUH%2F%2Bbeo%3D","updated":"2014-01-29 18:35:25.000000000","message":"Done","commit_id":"a9bf33932ae5703f1d36a51e284ee0f509646ffe"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"7327c91d3332de271f7c75356cafa13731d98004","unresolved":false,"context_lines":[{"line_number":855,"context_line":"        # allow traffic from subnets everything else will be denied"},{"line_number":856,"context_line":"        for subnet in network.subnets:"},{"line_number":857,"context_line":"            if not subnet.enable_dhcp:"},{"line_number":858,"context_line":"                continue"},{"line_number":859,"context_line":""},{"line_number":860,"context_line":"            tables \u003d im.ipv4 if subnet.ip_version \u003d\u003d IPV4 else im.ipv6"},{"line_number":861,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAUH%2F%2Bbec%3D","line":858,"updated":"2014-01-26 21:43:45.000000000","message":"Question: if the subnet does not allow dhcp at all, is there any reason for executing this function at all?","commit_id":"a9bf33932ae5703f1d36a51e284ee0f509646ffe"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"d9442d7506018f0abb5e262eba7f57dbe44aae1a","unresolved":false,"context_lines":[{"line_number":855,"context_line":"        # allow traffic from subnets everything else will be denied"},{"line_number":856,"context_line":"        for subnet in network.subnets:"},{"line_number":857,"context_line":"            if not subnet.enable_dhcp:"},{"line_number":858,"context_line":"                continue"},{"line_number":859,"context_line":""},{"line_number":860,"context_line":"            tables \u003d im.ipv4 if subnet.ip_version \u003d\u003d IPV4 else im.ipv6"},{"line_number":861,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAUH%2F%2BJWk%3D","line":858,"in_reply_to":"AAAAUH%2F%2Bbec%3D","updated":"2014-01-29 18:35:25.000000000","message":"Because one subnet can allow dhcp and another one for the same network could not allow it","commit_id":"a9bf33932ae5703f1d36a51e284ee0f509646ffe"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"0574111b12c9bd9c9d79af2c916ae7489c1b61c8","unresolved":false,"context_lines":[{"line_number":593,"context_line":"            im \u003d iptables_manager.IptablesManager("},{"line_number":594,"context_line":"                root_helper\u003droot_helper,"},{"line_number":595,"context_line":"                use_ipv6\u003dTrue,"},{"line_number":596,"context_line":"                namespace\u003dnetwork.namespace)"},{"line_number":597,"context_line":"            self.iptables_managers[ns] \u003d im"},{"line_number":598,"context_line":""},{"line_number":599,"context_line":"        return im"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FPq8%3D","line":596,"updated":"2014-02-14 15:55:47.000000000","message":"You could use namespace\u003dns here.","commit_id":"33fcf6ddd08d400a2b40f57f73c0d7bbb478aaa4"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"0574111b12c9bd9c9d79af2c916ae7489c1b61c8","unresolved":false,"context_lines":[{"line_number":644,"context_line":""},{"line_number":645,"context_line":"    def __init__(self, conf, root_helper, plugin):"},{"line_number":646,"context_line":"        self.conf \u003d conf"},{"line_number":647,"context_line":"        self.root_helper \u003d root_helper"},{"line_number":648,"context_line":"        self.plugin \u003d plugin"},{"line_number":649,"context_line":"        if not conf.interface_driver:"},{"line_number":650,"context_line":"            msg \u003d _(\u0027An interface driver must be specified\u0027)"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FPdM%3D","line":647,"updated":"2014-02-14 15:55:47.000000000","message":"I am just wondering ... if you passed the root_helper to iptables_manager_cache here, then you would not need the \u0027get_or_create\u0027 method? That would make the class simpler like InterfaceNameCache. I suppose that different DeviceManager instances could have different root_helpers, but does the cache class care which root_helper is used?","commit_id":"33fcf6ddd08d400a2b40f57f73c0d7bbb478aaa4"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"c9c527827f526e5fa60b933b687608602a98f4cf","unresolved":false,"context_lines":[{"line_number":644,"context_line":""},{"line_number":645,"context_line":"    def __init__(self, conf, root_helper, plugin):"},{"line_number":646,"context_line":"        self.conf \u003d conf"},{"line_number":647,"context_line":"        self.root_helper \u003d root_helper"},{"line_number":648,"context_line":"        self.plugin \u003d plugin"},{"line_number":649,"context_line":"        if not conf.interface_driver:"},{"line_number":650,"context_line":"            msg \u003d _(\u0027An interface driver must be specified\u0027)"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FOrQ%3D","line":647,"in_reply_to":"AAAAUX%2F%2FPPU%3D","updated":"2014-02-14 17:39:57.000000000","message":"Thanks for the clarification.","commit_id":"33fcf6ddd08d400a2b40f57f73c0d7bbb478aaa4"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"a93f8b69180d4f584b4ecbb71a444eccbb778b73","unresolved":false,"context_lines":[{"line_number":644,"context_line":""},{"line_number":645,"context_line":"    def __init__(self, conf, root_helper, plugin):"},{"line_number":646,"context_line":"        self.conf \u003d conf"},{"line_number":647,"context_line":"        self.root_helper \u003d root_helper"},{"line_number":648,"context_line":"        self.plugin \u003d plugin"},{"line_number":649,"context_line":"        if not conf.interface_driver:"},{"line_number":650,"context_line":"            msg \u003d _(\u0027An interface driver must be specified\u0027)"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FPPU%3D","line":647,"in_reply_to":"AAAAUX%2F%2FPdM%3D","updated":"2014-02-14 16:20:47.000000000","message":"The cache instance returned by the cache manager is related to the namespace not to the root_helper, so since every time the DeviceManager is instantiated the network namespace can change we still need the method get_or_create method and this is almost the same this with the root_helper, both are used by the IptablesManager instance returned, even if I agree the root_helper parameter probably comes from the config file which should not change.","commit_id":"33fcf6ddd08d400a2b40f57f73c0d7bbb478aaa4"},{"author":{"_account_id":55,"name":"Édouard Thuleau","email":"ethuleau@juniper.net","username":"ethuleau"},"change_message_id":"f07bfdaec9c441560096eea8f5cdeb79b8d24480","unresolved":false,"context_lines":[{"line_number":804,"context_line":""},{"line_number":805,"context_line":"        im \u003d DeviceManager.iptables_manager_cache.get(network)"},{"line_number":806,"context_line":"        if not im:"},{"line_number":807,"context_line":"            LOG.error(_(\"Error unable get the iptables manager created \""},{"line_number":808,"context_line":"                        \"for network %s\"), network.id)"},{"line_number":809,"context_line":"            return"},{"line_number":810,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FWuA%3D","line":807,"updated":"2014-02-13 19:11:40.000000000","message":"As Salvatore explained, you should also use warning log instead of error?","commit_id":"33fcf6ddd08d400a2b40f57f73c0d7bbb478aaa4"},{"author":{"_account_id":55,"name":"Édouard Thuleau","email":"ethuleau@juniper.net","username":"ethuleau"},"change_message_id":"ff5c8a67f9df48ae8cb4775f2cc10dbf81bb799e","unresolved":false,"context_lines":[{"line_number":804,"context_line":""},{"line_number":805,"context_line":"        im \u003d DeviceManager.iptables_manager_cache.get(network)"},{"line_number":806,"context_line":"        if not im:"},{"line_number":807,"context_line":"            LOG.error(_(\"Error unable get the iptables manager created \""},{"line_number":808,"context_line":"                        \"for network %s\"), network.id)"},{"line_number":809,"context_line":"            return"},{"line_number":810,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FRYc%3D","line":807,"in_reply_to":"AAAAUX%2F%2FVpY%3D","updated":"2014-02-14 10:41:26.000000000","message":"Right","commit_id":"33fcf6ddd08d400a2b40f57f73c0d7bbb478aaa4"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"c6cedf65855297c6a19e2832850e17f84c23b45d","unresolved":false,"context_lines":[{"line_number":804,"context_line":""},{"line_number":805,"context_line":"        im \u003d DeviceManager.iptables_manager_cache.get(network)"},{"line_number":806,"context_line":"        if not im:"},{"line_number":807,"context_line":"            LOG.error(_(\"Error unable get the iptables manager created \""},{"line_number":808,"context_line":"                        \"for network %s\"), network.id)"},{"line_number":809,"context_line":"            return"},{"line_number":810,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FVpY%3D","line":807,"in_reply_to":"AAAAUX%2F%2FWuA%3D","updated":"2014-02-13 21:27:21.000000000","message":"The first the above LOG.warn means that there is a destroy on a network which has never been setup, but this one is really an error since if we have an interface in the cache which means that the setup method has been called, we would have something in the iptables_manager_cache.","commit_id":"33fcf6ddd08d400a2b40f57f73c0d7bbb478aaa4"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"0574111b12c9bd9c9d79af2c916ae7489c1b61c8","unresolved":false,"context_lines":[{"line_number":820,"context_line":""},{"line_number":821,"context_line":"    def _apply_dns_isolation(self, network, interface_name\u003dNone):"},{"line_number":822,"context_line":"        if DeviceManager.iptables_manager_cache.is_up_to_date("},{"line_number":823,"context_line":"            network):"},{"line_number":824,"context_line":"            return"},{"line_number":825,"context_line":""},{"line_number":826,"context_line":"        im \u003d DeviceManager.iptables_manager_cache.get_or_create("}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FPv0%3D","line":823,"updated":"2014-02-14 15:55:47.000000000","message":"This fits in under 80 characters on line 822.","commit_id":"33fcf6ddd08d400a2b40f57f73c0d7bbb478aaa4"},{"author":{"_account_id":55,"name":"Édouard Thuleau","email":"ethuleau@juniper.net","username":"ethuleau"},"change_message_id":"f07bfdaec9c441560096eea8f5cdeb79b8d24480","unresolved":false,"context_lines":[{"line_number":826,"context_line":"        im \u003d DeviceManager.iptables_manager_cache.get_or_create("},{"line_number":827,"context_line":"            network, self.root_helper)"},{"line_number":828,"context_line":"        if not im:"},{"line_number":829,"context_line":"            LOG.error(_(\"Error unable to create or get an iptables manager \""},{"line_number":830,"context_line":"                        \"for network %s\"), network.id)"},{"line_number":831,"context_line":"            return"},{"line_number":832,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FWts%3D","line":829,"updated":"2014-02-13 19:11:40.000000000","message":"Same as above.","commit_id":"33fcf6ddd08d400a2b40f57f73c0d7bbb478aaa4"},{"author":{"_account_id":55,"name":"Édouard Thuleau","email":"ethuleau@juniper.net","username":"ethuleau"},"change_message_id":"ff5c8a67f9df48ae8cb4775f2cc10dbf81bb799e","unresolved":false,"context_lines":[{"line_number":826,"context_line":"        im \u003d DeviceManager.iptables_manager_cache.get_or_create("},{"line_number":827,"context_line":"            network, self.root_helper)"},{"line_number":828,"context_line":"        if not im:"},{"line_number":829,"context_line":"            LOG.error(_(\"Error unable to create or get an iptables manager \""},{"line_number":830,"context_line":"                        \"for network %s\"), network.id)"},{"line_number":831,"context_line":"            return"},{"line_number":832,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FRYw%3D","line":829,"in_reply_to":"AAAAUX%2F%2FVng%3D","updated":"2014-02-14 10:41:26.000000000","message":"Right","commit_id":"33fcf6ddd08d400a2b40f57f73c0d7bbb478aaa4"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"c6cedf65855297c6a19e2832850e17f84c23b45d","unresolved":false,"context_lines":[{"line_number":826,"context_line":"        im \u003d DeviceManager.iptables_manager_cache.get_or_create("},{"line_number":827,"context_line":"            network, self.root_helper)"},{"line_number":828,"context_line":"        if not im:"},{"line_number":829,"context_line":"            LOG.error(_(\"Error unable to create or get an iptables manager \""},{"line_number":830,"context_line":"                        \"for network %s\"), network.id)"},{"line_number":831,"context_line":"            return"},{"line_number":832,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FVng%3D","line":829,"in_reply_to":"AAAAUX%2F%2FWts%3D","updated":"2014-02-13 21:27:21.000000000","message":"If the isolation is set in the configuration and the agent is not able to apply it, I think this is an error not a warning since the dnsmasq will be exposed.","commit_id":"33fcf6ddd08d400a2b40f57f73c0d7bbb478aaa4"},{"author":{"_account_id":55,"name":"Édouard Thuleau","email":"ethuleau@juniper.net","username":"ethuleau"},"change_message_id":"f07bfdaec9c441560096eea8f5cdeb79b8d24480","unresolved":false,"context_lines":[{"line_number":833,"context_line":"        if not interface_name:"},{"line_number":834,"context_line":"            interface_name \u003d DeviceManager.interface_name_cache.get(network)"},{"line_number":835,"context_line":"        if not interface_name:"},{"line_number":836,"context_line":"            LOG.error(_(\"Error unable to get interface name for network: %s\"),"},{"line_number":837,"context_line":"                      network.id)"},{"line_number":838,"context_line":"            return"},{"line_number":839,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FWtk%3D","line":836,"updated":"2014-02-13 19:11:40.000000000","message":"Same as above.","commit_id":"33fcf6ddd08d400a2b40f57f73c0d7bbb478aaa4"},{"author":{"_account_id":55,"name":"Édouard Thuleau","email":"ethuleau@juniper.net","username":"ethuleau"},"change_message_id":"ff5c8a67f9df48ae8cb4775f2cc10dbf81bb799e","unresolved":false,"context_lines":[{"line_number":833,"context_line":"        if not interface_name:"},{"line_number":834,"context_line":"            interface_name \u003d DeviceManager.interface_name_cache.get(network)"},{"line_number":835,"context_line":"        if not interface_name:"},{"line_number":836,"context_line":"            LOG.error(_(\"Error unable to get interface name for network: %s\"),"},{"line_number":837,"context_line":"                      network.id)"},{"line_number":838,"context_line":"            return"},{"line_number":839,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FRYs%3D","line":836,"in_reply_to":"AAAAUX%2F%2FVoI%3D","updated":"2014-02-14 10:41:26.000000000","message":"Right","commit_id":"33fcf6ddd08d400a2b40f57f73c0d7bbb478aaa4"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"c6cedf65855297c6a19e2832850e17f84c23b45d","unresolved":false,"context_lines":[{"line_number":833,"context_line":"        if not interface_name:"},{"line_number":834,"context_line":"            interface_name \u003d DeviceManager.interface_name_cache.get(network)"},{"line_number":835,"context_line":"        if not interface_name:"},{"line_number":836,"context_line":"            LOG.error(_(\"Error unable to get interface name for network: %s\"),"},{"line_number":837,"context_line":"                      network.id)"},{"line_number":838,"context_line":"            return"},{"line_number":839,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAUX%2F%2FVoI%3D","line":836,"in_reply_to":"AAAAUX%2F%2FWtk%3D","updated":"2014-02-13 21:27:21.000000000","message":"same here.","commit_id":"33fcf6ddd08d400a2b40f57f73c0d7bbb478aaa4"}],"neutron/tests/unit/test_linux_dhcp.py":[{"author":{"_account_id":55,"name":"Édouard Thuleau","email":"ethuleau@juniper.net","username":"ethuleau"},"change_message_id":"b790de6fdf12c03c796c174f5ec95cb04e82373e","unresolved":false,"context_lines":[{"line_number":510,"context_line":"                                            \u0027-s 8.8.8.8/32 -j RETURN\u0027,"},{"line_number":511,"context_line":"                                            top\u003dTrue)]"},{"line_number":512,"context_line":""},{"line_number":513,"context_line":"                v4filter_inst.assert_has_calls(calls)"},{"line_number":514,"context_line":""},{"line_number":515,"context_line":"    def test_disable_not_active(self):"},{"line_number":516,"context_line":"        attrs_to_mock \u003d dict([(a, mock.DEFAULT) for a in"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F9QBw%3D","line":513,"updated":"2013-12-13 14:09:52.000000000","message":"Add test for _remove_isolation","commit_id":"62bdba22dd9cc5a84afe8a3e7cb459675d0595ed"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"d58783aaa099e380519a40d6c752a38eb4ea9546","unresolved":false,"context_lines":[{"line_number":510,"context_line":"                                            \u0027-s 8.8.8.8/32 -j RETURN\u0027,"},{"line_number":511,"context_line":"                                            top\u003dTrue)]"},{"line_number":512,"context_line":""},{"line_number":513,"context_line":"                v4filter_inst.assert_has_calls(calls)"},{"line_number":514,"context_line":""},{"line_number":515,"context_line":"    def test_disable_not_active(self):"},{"line_number":516,"context_line":"        attrs_to_mock \u003d dict([(a, mock.DEFAULT) for a in"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F9PwM%3D","line":513,"in_reply_to":"AAAATn%2F9QBw%3D","updated":"2013-12-13 15:03:22.000000000","message":"Sure in the next patch","commit_id":"62bdba22dd9cc5a84afe8a3e7cb459675d0595ed"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"32d80cba35f57280361e8548e88e5eaa2be990ce","unresolved":false,"context_lines":[{"line_number":691,"context_line":"                            return_value\u003diptables_inst):"},{"line_number":692,"context_line":"                with mock.patch(\u0027neutron.agent.linux.dhcp.\u0027"},{"line_number":693,"context_line":"                                \u0027DeviceManager.\u0027"},{"line_number":694,"context_line":"                                \u0027iptables_ns_manager\u0027) as ipm:"},{"line_number":695,"context_line":"                    ipm.get_or_create.return_value \u003d iptables_inst"},{"line_number":696,"context_line":"                    ipm.get.return_value \u003d iptables_inst"},{"line_number":697,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAT3%2F%2F5aE%3D","line":694,"updated":"2013-12-27 17:17:30.000000000","message":"I think you can use contextlib.nested() for these nested withs to reduce the indentation.","commit_id":"79d58d6a7927f9605b22930dfce42d66e32f5981"},{"author":{"_account_id":55,"name":"Édouard Thuleau","email":"ethuleau@juniper.net","username":"ethuleau"},"change_message_id":"9f6a21889a939a6d27f238f9b223aea03cd8367f","unresolved":false,"context_lines":[{"line_number":494,"context_line":"        im \u003d im_cache.get(\u0027def\u0027)"},{"line_number":495,"context_line":"        self.assertEqual(im, im2)"},{"line_number":496,"context_line":"        im \u003d im_cache.get(\u0027ghi\u0027)"},{"line_number":497,"context_line":"        self.assertEqual(im, None)"},{"line_number":498,"context_line":""},{"line_number":499,"context_line":"    def test_apply_dns_isolation_non_existing_port(self):"},{"line_number":500,"context_line":"        self.device_mock.stop()"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUH%2F%2Fzrs%3D","line":497,"updated":"2014-01-08 08:05:41.000000000","message":"Don\u0027t test remove method?","commit_id":"f284ec5ccccd5843cc296336af8fdf79fbc4e67f"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"a26cb6fee959294ac50fce6d0c13b7c4b3bd2e56","unresolved":false,"context_lines":[{"line_number":494,"context_line":"        im \u003d im_cache.get(\u0027def\u0027)"},{"line_number":495,"context_line":"        self.assertEqual(im, im2)"},{"line_number":496,"context_line":"        im \u003d im_cache.get(\u0027ghi\u0027)"},{"line_number":497,"context_line":"        self.assertEqual(im, None)"},{"line_number":498,"context_line":""},{"line_number":499,"context_line":"    def test_apply_dns_isolation_non_existing_port(self):"},{"line_number":500,"context_line":"        self.device_mock.stop()"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUH%2F%2FzHY%3D","line":497,"in_reply_to":"AAAAUH%2F%2Fzrs%3D","updated":"2014-01-08 10:21:34.000000000","message":"Done","commit_id":"f284ec5ccccd5843cc296336af8fdf79fbc4e67f"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"abc3c8c0ceea21964fe88bf8ce35f0b13bb8094f","unresolved":false,"context_lines":[{"line_number":480,"context_line":"    def test_namespace_iptables_manager_cache(self):"},{"line_number":481,"context_line":"        im_cache \u003d dhcp.NamespaceIptablesManagerCache()"},{"line_number":482,"context_line":"        im1 \u003d im_cache.get_or_create(\u0027abc\u0027, \u0027sudo\u0027)"},{"line_number":483,"context_line":"        self.assertNotEqual(im1, None)"},{"line_number":484,"context_line":""},{"line_number":485,"context_line":"        im \u003d im_cache.get_or_create(\u0027abc\u0027, \u0027sudo\u0027)"},{"line_number":486,"context_line":"        self.assertEqual(im, im1)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2Fd%2Bw%3D","line":483,"updated":"2014-01-13 16:30:48.000000000","message":"self.assertIsNotNone(im1)","commit_id":"270c98bf1e2e1d94039c3b0737c31aba65f1eace"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"abc3c8c0ceea21964fe88bf8ce35f0b13bb8094f","unresolved":false,"context_lines":[{"line_number":496,"context_line":"        self.assertEqual(im, im2)"},{"line_number":497,"context_line":""},{"line_number":498,"context_line":"        im \u003d im_cache.get(\u0027ghi\u0027)"},{"line_number":499,"context_line":"        self.assertEqual(im, None)"},{"line_number":500,"context_line":""},{"line_number":501,"context_line":"        im_cache.remove(\u0027abc\u0027)"},{"line_number":502,"context_line":"        im \u003d im_cache.get(\u0027abc\u0027)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2Fd9w%3D","line":499,"updated":"2014-01-13 16:30:48.000000000","message":"self.assertIsNone ...","commit_id":"270c98bf1e2e1d94039c3b0737c31aba65f1eace"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"abc3c8c0ceea21964fe88bf8ce35f0b13bb8094f","unresolved":false,"context_lines":[{"line_number":654,"context_line":"                                          \u0027-s fdca:3ba5:a17a:4ba3::/64\u0027"},{"line_number":655,"context_line":"                                          \u0027 -j RETURN\u0027, top\u003dTrue)]"},{"line_number":656,"context_line":"            v6filter_inst.assert_has_calls(callsv6)"},{"line_number":657,"context_line":""},{"line_number":658,"context_line":"    def test_remove_dns_isolation(self):"},{"line_number":659,"context_line":"        self.device_mock.stop()"},{"line_number":660,"context_line":"        self.conf.set_override(\u0027interface_driver\u0027,"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAUH%2F%2Fd8s%3D","line":657,"updated":"2014-01-13 16:30:48.000000000","message":"I guess these tests should also check that apply() was called on iptables_inst","commit_id":"270c98bf1e2e1d94039c3b0737c31aba65f1eace"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"7327c91d3332de271f7c75356cafa13731d98004","unresolved":false,"context_lines":[{"line_number":548,"context_line":"        network \u003d FakeV4Network()"},{"line_number":549,"context_line":"        int_cache.set(network, \u0027tap123\u0027)"},{"line_number":550,"context_line":"        name \u003d int_cache.get(FakeV4SubnetNoRouter())"},{"line_number":551,"context_line":"        self.assertEqual(name, None)"},{"line_number":552,"context_line":""},{"line_number":553,"context_line":"    def test_apply_dns_isolation_non_existing_port(self):"},{"line_number":554,"context_line":"        self.device_mock.stop()"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAUH%2F%2BbeY%3D","line":551,"updated":"2014-01-26 21:43:45.000000000","message":"perhaps the 3rd assert could be performed before the 2nd thus avoiding reinserting the network in the cache","commit_id":"a9bf33932ae5703f1d36a51e284ee0f509646ffe"},{"author":{"_account_id":7141,"name":"Sylvain Afchain","email":"safchain@redhat.com","username":"sylvainA"},"change_message_id":"d9442d7506018f0abb5e262eba7f57dbe44aae1a","unresolved":false,"context_lines":[{"line_number":548,"context_line":"        network \u003d FakeV4Network()"},{"line_number":549,"context_line":"        int_cache.set(network, \u0027tap123\u0027)"},{"line_number":550,"context_line":"        name \u003d int_cache.get(FakeV4SubnetNoRouter())"},{"line_number":551,"context_line":"        self.assertEqual(name, None)"},{"line_number":552,"context_line":""},{"line_number":553,"context_line":"    def test_apply_dns_isolation_non_existing_port(self):"},{"line_number":554,"context_line":"        self.device_mock.stop()"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAUH%2F%2BJOo%3D","line":551,"in_reply_to":"AAAAUH%2F%2BbeY%3D","updated":"2014-01-29 18:35:25.000000000","message":"Done","commit_id":"a9bf33932ae5703f1d36a51e284ee0f509646ffe"}]}
