)]}'
{"neutron/db/securitygroups_rpc_base.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"958d534fe688be8dab9afe204164ee1a37c38ea4","unresolved":false,"context_lines":[{"line_number":124,"context_line":"            # update provider rule if port has one or more IPv6 address"},{"line_number":125,"context_line":"            for fixed_ip in port[\u0027fixed_ips\u0027]:"},{"line_number":126,"context_line":"                query \u003d context.session.query(models_v2.Subnet)"},{"line_number":127,"context_line":"                subnet \u003d query.filter_by(id\u003dfixed_ip[\u0027subnet_id\u0027]).one()"},{"line_number":128,"context_line":"                if subnet.ip_version \u003d\u003d 6:"},{"line_number":129,"context_line":"                    self.notifier.security_groups_provider_updated(context)"},{"line_number":130,"context_line":"                    break"}],"source_content_type":"text/x-python","patch_set":4,"id":"7adec928_fba8a121","line":127,"updated":"2014-05-20 05:35:31.000000000","message":"It would be much better from a performance perspective to run one query for all of the subnets than an individual query for each fixed_ip.  Then, after the query comes back look through for any ipv6 subnets.","commit_id":"4b68979042c43032d1208bd0a6effbfd5314349d"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"04a4c8086f9c4615a65677442d4d26dc0b10ea14","unresolved":false,"context_lines":[{"line_number":124,"context_line":"            # update provider rule if port has one or more IPv6 address"},{"line_number":125,"context_line":"            for fixed_ip in port[\u0027fixed_ips\u0027]:"},{"line_number":126,"context_line":"                query \u003d context.session.query(models_v2.Subnet)"},{"line_number":127,"context_line":"                subnet \u003d query.filter_by(id\u003dfixed_ip[\u0027subnet_id\u0027]).one()"},{"line_number":128,"context_line":"                if subnet.ip_version \u003d\u003d 6:"},{"line_number":129,"context_line":"                    self.notifier.security_groups_provider_updated(context)"},{"line_number":130,"context_line":"                    break"}],"source_content_type":"text/x-python","patch_set":4,"id":"7adec928_e5c43661","line":127,"in_reply_to":"7adec928_fba8a121","updated":"2014-05-22 06:49:27.000000000","message":"Carl. Thanks. I will improve this in next patch.","commit_id":"4b68979042c43032d1208bd0a6effbfd5314349d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"dbd8ad9917270b995b589d39ba45edcd457d5a31","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        # router interface is created or updated after VM port is created"},{"line_number":123,"context_line":"        elif port[\u0027device_owner\u0027] \u003d\u003d q_const.DEVICE_OWNER_ROUTER_INTF:"},{"line_number":124,"context_line":"            # update provider rule if port has one or more IPv6 address"},{"line_number":125,"context_line":"            subnets \u003d context.session.query(models_v2.Subnet).all()"},{"line_number":126,"context_line":"            for fixed_ip in port[\u0027fixed_ips\u0027]:"},{"line_number":127,"context_line":"                for subnet in subnets:"},{"line_number":128,"context_line":"                    if (fixed_ip[\u0027subnet_id\u0027] \u003d\u003d subnet.id and"}],"source_content_type":"text/x-python","patch_set":5,"id":"7adec928_0e2f62a2","line":125,"updated":"2014-05-23 04:10:57.000000000","message":"This is pretty inefficient as well because it will query all subnets.  That could be a lot of subnets.  The following shows what I had in mind.  It may not be quite right but shows the idea.\n\nsubnet_ids \u003d [fixed_ip[\u0027subnet_id\u0027] for fixed_ip in port[\u0027fixed_ips\u0027]\nquery \u003d context.session.query(models_v2.Subnet)\nsubnets \u003d query.fliter(models_v2.Subnet.id.in_(subnet_ids)).filter(ip_version\u003d6).all()\n\nfor subnet in subnets:\n    ... \n\nhttp://docs.sqlalchemy.org/en/rel_0_9/orm/tutorial.html","commit_id":"4c9b16c0c3854c6507ce5cd1de5c82325ac88837"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"9f72e25d7766776ea8df088453d9172196d5f331","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        # router interface is created or updated after VM port is created"},{"line_number":123,"context_line":"        elif port[\u0027device_owner\u0027] \u003d\u003d q_const.DEVICE_OWNER_ROUTER_INTF:"},{"line_number":124,"context_line":"            # update provider rule if port has one or more IPv6 address"},{"line_number":125,"context_line":"            subnets \u003d context.session.query(models_v2.Subnet).all()"},{"line_number":126,"context_line":"            for fixed_ip in port[\u0027fixed_ips\u0027]:"},{"line_number":127,"context_line":"                for subnet in subnets:"},{"line_number":128,"context_line":"                    if (fixed_ip[\u0027subnet_id\u0027] \u003d\u003d subnet.id and"}],"source_content_type":"text/x-python","patch_set":5,"id":"7adec928_ff4d82c5","line":125,"in_reply_to":"7adec928_0e2f62a2","updated":"2014-05-23 06:52:03.000000000","message":"Thanks for the advice! I will improve in next patch.","commit_id":"4c9b16c0c3854c6507ce5cd1de5c82325ac88837"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"dbd8ad9917270b995b589d39ba45edcd457d5a31","unresolved":false,"context_lines":[{"line_number":124,"context_line":"            # update provider rule if port has one or more IPv6 address"},{"line_number":125,"context_line":"            subnets \u003d context.session.query(models_v2.Subnet).all()"},{"line_number":126,"context_line":"            for fixed_ip in port[\u0027fixed_ips\u0027]:"},{"line_number":127,"context_line":"                for subnet in subnets:"},{"line_number":128,"context_line":"                    if (fixed_ip[\u0027subnet_id\u0027] \u003d\u003d subnet.id and"},{"line_number":129,"context_line":"                        subnet.ip_version \u003d\u003d 6):"},{"line_number":130,"context_line":"                        self.notifier.security_groups_provider_updated(context)"}],"source_content_type":"text/x-python","patch_set":5,"id":"7adec928_6e1b8680","line":127,"updated":"2014-05-23 04:10:57.000000000","message":"Watch out for these O(nm) loops.","commit_id":"4c9b16c0c3854c6507ce5cd1de5c82325ac88837"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e19b11b90546e36cc0a52757cc7db787f5343e71","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        # Note(xuhanp): For IPv6, provider rule need to be updated in case"},{"line_number":122,"context_line":"        # router interface is created or updated after VM port is created"},{"line_number":123,"context_line":"        elif port[\u0027device_owner\u0027] \u003d\u003d q_const.DEVICE_OWNER_ROUTER_INTF:"},{"line_number":124,"context_line":"            # update provider rule if port has one or more IPv6 address"},{"line_number":125,"context_line":"            subnet_ids \u003d [fixed_ip[\u0027subnet_id\u0027] for fixed_ip in"},{"line_number":126,"context_line":"                          port[\u0027fixed_ips\u0027]]"},{"line_number":127,"context_line":"            query \u003d context.session.query(models_v2.Subnet)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ae8d1ca_e1c50e5c","line":124,"updated":"2014-05-28 08:53:15.000000000","message":"So why is it necessary to query the database?  Can we not look at the fixed_ips and if any are version 6 then trigger a notification?  Seems like this will be equivalent.\n\nelif port[\u0027device_owner\u0027] \u003d\u003d q_const.DEVICE_OWNER_ROUTER_INTF:\n    if any(netaddr.IPAddress(fixed[\u0027ip_address\u0027]).version \u003d\u003d 6 for fixed in port[\u0027fixed_ips\u0027]):\n        self.notifier.security_groups_provider_updated(context)","commit_id":"c157dbfe8ddec8bb140f492963ba69d238e681f2"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"ba4c228a5240b500850829aba2e1873970f7eafa","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        # Note(xuhanp): For IPv6, provider rule need to be updated in case"},{"line_number":122,"context_line":"        # router interface is created or updated after VM port is created"},{"line_number":123,"context_line":"        elif port[\u0027device_owner\u0027] \u003d\u003d q_const.DEVICE_OWNER_ROUTER_INTF:"},{"line_number":124,"context_line":"            # update provider rule if port has one or more IPv6 address"},{"line_number":125,"context_line":"            subnet_ids \u003d [fixed_ip[\u0027subnet_id\u0027] for fixed_ip in"},{"line_number":126,"context_line":"                          port[\u0027fixed_ips\u0027]]"},{"line_number":127,"context_line":"            query \u003d context.session.query(models_v2.Subnet)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ae5cdf2_eb5eb475","line":124,"in_reply_to":"3ae8d1ca_e1c50e5c","updated":"2014-06-02 07:44:25.000000000","message":"Thanks for the comment! This looks much better than my previous approach. Will change in next patch.","commit_id":"c157dbfe8ddec8bb140f492963ba69d238e681f2"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e19b11b90546e36cc0a52757cc7db787f5343e71","unresolved":false,"context_lines":[{"line_number":125,"context_line":"            subnet_ids \u003d [fixed_ip[\u0027subnet_id\u0027] for fixed_ip in"},{"line_number":126,"context_line":"                          port[\u0027fixed_ips\u0027]]"},{"line_number":127,"context_line":"            query \u003d context.session.query(models_v2.Subnet)"},{"line_number":128,"context_line":"            subnets \u003d query.filter(models_v2.Subnet.id.in_("},{"line_number":129,"context_line":"                                   subnet_ids)).filter_by(ip_version\u003d6).all()"},{"line_number":130,"context_line":"            if len(subnets) \u003e 0:"},{"line_number":131,"context_line":"                self.notifier.security_groups_provider_updated(context)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ae8d1ca_0183da56","line":128,"updated":"2014-05-28 08:53:15.000000000","message":"If we need the old form, there\u0027s no reason to retrieve the objects.  You should use .count() here.\n\nnum_subnets \u003d query.filter(\n    models_v2.Subnet.id.in_(subnet_ids)).filter_by(\n        ip_version\u003d6).count()\nif num_subnets:\n    self.notifier.security_groups_provider_updated(context)","commit_id":"c157dbfe8ddec8bb140f492963ba69d238e681f2"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"582d0586bb008bc4dc4860ecc9f8f34556b6ae1d","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        \"\"\""},{"line_number":119,"context_line":"        if port[\u0027device_owner\u0027] \u003d\u003d q_const.DEVICE_OWNER_DHCP:"},{"line_number":120,"context_line":"            self.notifier.security_groups_provider_updated(context)"},{"line_number":121,"context_line":"        # Note(xuhanp): For IPv6, provider rule need to be updated in case"},{"line_number":122,"context_line":"        # router interface is created or updated after VM port is created"},{"line_number":123,"context_line":"        elif port[\u0027device_owner\u0027] \u003d\u003d q_const.DEVICE_OWNER_ROUTER_INTF:"},{"line_number":124,"context_line":"            # update provider rule if port has one or more IPv6 address"}],"source_content_type":"text/x-python","patch_set":9,"id":"1ae5cdf2_2af003c8","line":121,"updated":"2014-06-05 17:49:09.000000000","message":"It it not necessary to leave developer signatures on comments that explain reasoning","commit_id":"0ef1999edadd2c04cb715fc271dfb8a51701ce9f"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"7cd326f52b08b60b664126fad9713c622483df7b","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        \"\"\""},{"line_number":119,"context_line":"        if port[\u0027device_owner\u0027] \u003d\u003d q_const.DEVICE_OWNER_DHCP:"},{"line_number":120,"context_line":"            self.notifier.security_groups_provider_updated(context)"},{"line_number":121,"context_line":"        # Note(xuhanp): For IPv6, provider rule need to be updated in case"},{"line_number":122,"context_line":"        # router interface is created or updated after VM port is created"},{"line_number":123,"context_line":"        elif port[\u0027device_owner\u0027] \u003d\u003d q_const.DEVICE_OWNER_ROUTER_INTF:"},{"line_number":124,"context_line":"            # update provider rule if port has one or more IPv6 address"}],"source_content_type":"text/x-python","patch_set":9,"id":"1ae5cdf2_9aa4f808","line":121,"in_reply_to":"1ae5cdf2_2af003c8","updated":"2014-06-06 02:54:41.000000000","message":"Done","commit_id":"0ef1999edadd2c04cb715fc271dfb8a51701ce9f"}],"neutron/tests/unit/bigswitch/test_security_groups.py":[{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"878f101a8fde067c30b0afda0c2fb5b930142b71","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                    self.notifier,"},{"line_number":51,"context_line":"                    \u0027security_groups_provider_updated\u0027) as m:"},{"line_number":52,"context_line":"                    # Create gateway port"},{"line_number":53,"context_line":"                    res \u003d self._create_port("},{"line_number":54,"context_line":"                        self.fmt, n[\u0027network\u0027][\u0027id\u0027],"},{"line_number":55,"context_line":"                        fixed_ips\u003d[{\u0027subnet_id\u0027: subnet[\u0027subnet\u0027][\u0027id\u0027],"},{"line_number":56,"context_line":"                                    \u0027ip_address\u0027: \u00272001:0db8::1\u0027}],"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F9bXo%3D","line":53,"updated":"2014-04-04 15:43:00.000000000","message":"lines 44 to 60 are repeated in all the test cases, consider creating a method for that.\n\ndef _test_security_group_port(self, device_owner, gw_ip, cidr, ip_version, ip_address):\n     with self.network() as n:\n        with self.subnet(n, gateway_ip\u003dgw_ip, cidr\u003dcidr, ip_version\u003dip_version) as subnet:\n            with mock.patch.object(\n                self.notifier,\n                \u0027security_groups_provider_updated\u0027) as m:\n                 res \u003d self._create_port(\n                     self.fmt, n[\u0027network\u0027][\u0027id\u0027],\n                     fixed_ips\u003d[{\u0027subnet_id\u0027: subnet[\u0027subnet\u0027][\u0027id\u0027],\n                                       \u0027ip_address\u0027: ip_address}],\n                                       device_owner\u003ddevice_owner)\n\n                 res \u003d self.deserialize(self.fmt, res)\n                 port_id \u003d res[\u0027port\u0027][\u0027id\u0027]\n                 self.addCleanup(self._delete(\u0027ports\u0027, port_id))\n                 return m\n\nthen in your tests you can simply do:\n\nm \u003d self._test_security_group_port(device_owner, ip_version, ip_address)\n\nand use m  for the assertion.\n\nYou probably have to add some cleanup is it\u0027s the gateway port and also check if some parameter is None (for example device_owner is not always set in your tests)\n\nPlease check my code, it\u0027s hard to write code in a comment :)","commit_id":"9da274083b9cfd600b35ca343b233d20386c432d"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"3c2bc3bdb7e0984177c2efb3e9be3fde5abe5f61","unresolved":false,"context_lines":[{"line_number":50,"context_line":"                    self.notifier,"},{"line_number":51,"context_line":"                    \u0027security_groups_provider_updated\u0027) as m:"},{"line_number":52,"context_line":"                    # Create gateway port"},{"line_number":53,"context_line":"                    res \u003d self._create_port("},{"line_number":54,"context_line":"                        self.fmt, n[\u0027network\u0027][\u0027id\u0027],"},{"line_number":55,"context_line":"                        fixed_ips\u003d[{\u0027subnet_id\u0027: subnet[\u0027subnet\u0027][\u0027id\u0027],"},{"line_number":56,"context_line":"                                    \u0027ip_address\u0027: \u00272001:0db8::1\u0027}],"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWn%2F%2F%2FTU%3D","line":53,"in_reply_to":"AAAAWH%2F9bXo%3D","updated":"2014-04-08 03:34:14.000000000","message":"Will address this in next patch.","commit_id":"9da274083b9cfd600b35ca343b233d20386c432d"}],"neutron/tests/unit/ml2/test_security_group.py":[{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"878f101a8fde067c30b0afda0c2fb5b930142b71","unresolved":false,"context_lines":[{"line_number":98,"context_line":"    Ml2SecurityGroupsTestCase,"},{"line_number":99,"context_line":"    test_sg_rpc.SGServerRpcCallBackMixinTestCase):"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def test_notify_security_group_ipv6_gateway_port_added(self):"},{"line_number":102,"context_line":"        with self.network() as n:"},{"line_number":103,"context_line":"            with self.subnet(n,"},{"line_number":104,"context_line":"                             gateway_ip\u003d\u00272001:0db8::1\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F9bTc%3D","line":101,"updated":"2014-04-04 15:43:00.000000000","message":"same suggestion here as in the previous file","commit_id":"9da274083b9cfd600b35ca343b233d20386c432d"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"3c2bc3bdb7e0984177c2efb3e9be3fde5abe5f61","unresolved":false,"context_lines":[{"line_number":98,"context_line":"    Ml2SecurityGroupsTestCase,"},{"line_number":99,"context_line":"    test_sg_rpc.SGServerRpcCallBackMixinTestCase):"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def test_notify_security_group_ipv6_gateway_port_added(self):"},{"line_number":102,"context_line":"        with self.network() as n:"},{"line_number":103,"context_line":"            with self.subnet(n,"},{"line_number":104,"context_line":"                             gateway_ip\u003d\u00272001:0db8::1\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWn%2F%2F%2FSo%3D","line":101,"in_reply_to":"AAAAWH%2F9bTc%3D","updated":"2014-04-08 03:34:14.000000000","message":"will address in next patch","commit_id":"9da274083b9cfd600b35ca343b233d20386c432d"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"baee9c886460f3d7d9655f5a0c632ff132deefe6","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from neutron.tests.unit import test_security_groups_rpc as test_sg_rpc"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"PLUGIN_NAME \u003d \u0027neutron.plugins.ml2.plugin.Ml2Plugin\u0027"},{"line_number":27,"context_line":"NOTIFIER \u003d \u0027neutron.plugins.ml2.rpc.AgentNotifierApi\u0027"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"class Ml2SecurityGroupsTestCase(test_sg.SecurityGroupDBTestCase):"}],"source_content_type":"text/x-python","patch_set":6,"id":"5adbc538_d5f7178b","line":27,"updated":"2014-05-26 03:23:59.000000000","message":"I will need this mocked notifier to test the security_groups_provider_updated function of the notifier. This is not defined in SGServerRpcCallBackMixinTestCase. Therefore an error like this will occur is I move the test to SGServerRpcCallBackMixinTestCase:\n\nAttributeError: \u0027SGServerRpcCallBackMixinTestCase\u0027 object has no attribute \u0027notifier\u0027","commit_id":"320050ed377e835b7c06281913e8bcb23c3e83b3"}],"neutron/tests/unit/test_security_groups_rpc.py":[{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e19b11b90546e36cc0a52757cc7db787f5343e71","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def _test_security_group_port(self, device_owner, gw_ip,"},{"line_number":70,"context_line":"                                  cidr, ip_version, ip_address):"},{"line_number":71,"context_line":"        with self.network() as n:"},{"line_number":72,"context_line":"            with self.subnet(n,"},{"line_number":73,"context_line":"                             gateway_ip\u003dgw_ip,"},{"line_number":74,"context_line":"                             cidr\u003dcidr,"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ae8d1ca_a1794631","line":71,"updated":"2014-05-28 08:53:15.000000000","message":"please use a more descriptive variable name: net","commit_id":"c157dbfe8ddec8bb140f492963ba69d238e681f2"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"ba4c228a5240b500850829aba2e1873970f7eafa","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def _test_security_group_port(self, device_owner, gw_ip,"},{"line_number":70,"context_line":"                                  cidr, ip_version, ip_address):"},{"line_number":71,"context_line":"        with self.network() as n:"},{"line_number":72,"context_line":"            with self.subnet(n,"},{"line_number":73,"context_line":"                             gateway_ip\u003dgw_ip,"},{"line_number":74,"context_line":"                             cidr\u003dcidr,"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ae5cdf2_6b72a44a","line":71,"in_reply_to":"3ae8d1ca_a1794631","updated":"2014-06-02 07:44:25.000000000","message":"Will improve in next patch.","commit_id":"c157dbfe8ddec8bb140f492963ba69d238e681f2"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"e19b11b90546e36cc0a52757cc7db787f5343e71","unresolved":false,"context_lines":[{"line_number":75,"context_line":"                             ip_version\u003dip_version) as subnet:"},{"line_number":76,"context_line":"                with mock.patch.object("},{"line_number":77,"context_line":"                    self.notifier,"},{"line_number":78,"context_line":"                    \u0027security_groups_provider_updated\u0027) as m:"},{"line_number":79,"context_line":"                    kwargs \u003d {"},{"line_number":80,"context_line":"                        \u0027fixed_ips\u0027: [{\u0027subnet_id\u0027: subnet[\u0027subnet\u0027][\u0027id\u0027],"},{"line_number":81,"context_line":"                                       \u0027ip_address\u0027: ip_address}]}"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ae8d1ca_419a4264","line":78,"updated":"2014-05-28 08:53:15.000000000","message":"m -\u003e mock_notifier","commit_id":"c157dbfe8ddec8bb140f492963ba69d238e681f2"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"ba4c228a5240b500850829aba2e1873970f7eafa","unresolved":false,"context_lines":[{"line_number":75,"context_line":"                             ip_version\u003dip_version) as subnet:"},{"line_number":76,"context_line":"                with mock.patch.object("},{"line_number":77,"context_line":"                    self.notifier,"},{"line_number":78,"context_line":"                    \u0027security_groups_provider_updated\u0027) as m:"},{"line_number":79,"context_line":"                    kwargs \u003d {"},{"line_number":80,"context_line":"                        \u0027fixed_ips\u0027: [{\u0027subnet_id\u0027: subnet[\u0027subnet\u0027][\u0027id\u0027],"},{"line_number":81,"context_line":"                                       \u0027ip_address\u0027: ip_address}]}"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ae5cdf2_eb9dd45a","line":78,"in_reply_to":"3ae8d1ca_419a4264","updated":"2014-06-02 07:44:25.000000000","message":"Will change in next patch.","commit_id":"c157dbfe8ddec8bb140f492963ba69d238e681f2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1fbb54c08ee0703ca7b822872e176b36c847837b","unresolved":false,"context_lines":[{"line_number":98,"context_line":"            self.skipTest(\"Notifier mock is not set so security group \""},{"line_number":99,"context_line":"                          \"RPC calls can\u0027t be tested\")"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"        m \u003d self._test_security_group_port(const.DEVICE_OWNER_ROUTER_INTF,"},{"line_number":102,"context_line":"                                           \u00272001:0db8::1\u0027,"},{"line_number":103,"context_line":"                                           \u00272001:0db8::/64\u0027,"},{"line_number":104,"context_line":"                                           6,"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ae8d1ca_d201e93a","line":101,"updated":"2014-05-27 10:48:52.000000000","message":"a more meaningful name instead of m would help readability. Maybe security_groups_provider_updated_mock","commit_id":"c157dbfe8ddec8bb140f492963ba69d238e681f2"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"6f5f9361632e9bdbb4fcf3b5060a7078d62e2e32","unresolved":false,"context_lines":[{"line_number":98,"context_line":"            self.skipTest(\"Notifier mock is not set so security group \""},{"line_number":99,"context_line":"                          \"RPC calls can\u0027t be tested\")"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"        m \u003d self._test_security_group_port(const.DEVICE_OWNER_ROUTER_INTF,"},{"line_number":102,"context_line":"                                           \u00272001:0db8::1\u0027,"},{"line_number":103,"context_line":"                                           \u00272001:0db8::/64\u0027,"},{"line_number":104,"context_line":"                                           6,"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ae8d1ca_00891feb","line":101,"in_reply_to":"3ae8d1ca_d201e93a","updated":"2014-05-28 02:06:44.000000000","message":"Will improve in next patch.","commit_id":"c157dbfe8ddec8bb140f492963ba69d238e681f2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1fbb54c08ee0703ca7b822872e176b36c847837b","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                                           6,"},{"line_number":105,"context_line":"                                           \u00272001:0db8::1\u0027)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"        m.assert_called_with(mock.ANY)"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def test_notify_security_group_ipv6_normal_port_added(self):"},{"line_number":110,"context_line":"        if getattr(self, \"notifier\", None) is None:"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ae8d1ca_f27345e5","line":107,"updated":"2014-05-27 10:48:52.000000000","message":"I\u0027d prefer:\nself.assertTrue(m.called)\n\nit\u0027s also more consistent with the rest of your code","commit_id":"c157dbfe8ddec8bb140f492963ba69d238e681f2"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"6f5f9361632e9bdbb4fcf3b5060a7078d62e2e32","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                                           6,"},{"line_number":105,"context_line":"                                           \u00272001:0db8::1\u0027)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"        m.assert_called_with(mock.ANY)"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def test_notify_security_group_ipv6_normal_port_added(self):"},{"line_number":110,"context_line":"        if getattr(self, \"notifier\", None) is None:"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ae8d1ca_406a471b","line":107,"in_reply_to":"3ae8d1ca_f27345e5","updated":"2014-05-28 02:06:44.000000000","message":"Will improve in next patch.","commit_id":"c157dbfe8ddec8bb140f492963ba69d238e681f2"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"1fbb54c08ee0703ca7b822872e176b36c847837b","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                                           \u0027192.168.1.0/24\u0027,"},{"line_number":127,"context_line":"                                           4,"},{"line_number":128,"context_line":"                                           \u0027192.168.1.2\u0027)"},{"line_number":129,"context_line":"        m.assert_called_with(mock.ANY)"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    def test_notify_security_group_ipv4_gateway_port_added(self):"},{"line_number":132,"context_line":"        if getattr(self, \"notifier\", None) is None:"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ae8d1ca_524a3984","line":129,"updated":"2014-05-27 10:48:52.000000000","message":"Same here","commit_id":"c157dbfe8ddec8bb140f492963ba69d238e681f2"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"582d0586bb008bc4dc4860ecc9f8f34556b6ae1d","unresolved":false,"context_lines":[{"line_number":94,"context_line":"                    return mock_notifier"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def test_notify_security_group_ipv6_gateway_port_added(self):"},{"line_number":97,"context_line":"        if getattr(self, \"notifier\", None) is None:"},{"line_number":98,"context_line":"            self.skipTest(\"Notifier mock is not set so security group \""},{"line_number":99,"context_line":"                          \"RPC calls can\u0027t be tested\")"},{"line_number":100,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"1ae5cdf2_0ae50708","line":97,"updated":"2014-06-05 17:49:09.000000000","message":"there should be a notifier for tests setup, so we should not be skipping here","commit_id":"0ef1999edadd2c04cb715fc271dfb8a51701ce9f"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"7cd326f52b08b60b664126fad9713c622483df7b","unresolved":false,"context_lines":[{"line_number":94,"context_line":"                    return mock_notifier"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def test_notify_security_group_ipv6_gateway_port_added(self):"},{"line_number":97,"context_line":"        if getattr(self, \"notifier\", None) is None:"},{"line_number":98,"context_line":"            self.skipTest(\"Notifier mock is not set so security group \""},{"line_number":99,"context_line":"                          \"RPC calls can\u0027t be tested\")"},{"line_number":100,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"1ae5cdf2_9a7b187a","line":97,"in_reply_to":"1ae5cdf2_0ae50708","updated":"2014-06-06 02:54:41.000000000","message":"notifier is not mocked in SGServerRpcCallBackMixinTestCase\u0027s setup because the agent notifier api is defined per plugin. For example, this is defined in test_ovs_security_group.py\n\nNOTIFIER \u003d (\u0027neutron.plugins.openvswitch.\u0027\n            \u0027ovs_neutron_plugin.AgentNotifierApi\u0027)\n\nWe will get AttributeError in test: neutron.tests.unit.test_security_groups_rpc.SGServerRpcCallBackMixinTestCase.test_notify_security_group_ipv6_gateway_port_added","commit_id":"0ef1999edadd2c04cb715fc271dfb8a51701ce9f"}]}
