)]}'
{"nova/network/neutronv2/api.py":[{"author":{"_account_id":14819,"name":"Timofey Durakov","email":"timofei.nd@gmail.com","username":"tdurakov"},"change_message_id":"6327bebb6bc140b66ffc016b7a7183850cb3bd39","unresolved":false,"context_lines":[{"line_number":1405,"context_line":"        # list_floatingips will be raised."},{"line_number":1406,"context_line":"        except neutron_client_exc.NeutronClientException as e:"},{"line_number":1407,"context_line":"            if e.status_code \u003d\u003d 404:"},{"line_number":1408,"context_line":"                return []"},{"line_number":1409,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":1410,"context_line":"                LOG.exception(_LE(\u0027Unable to access floating IPs for project \u0027"},{"line_number":1411,"context_line":"                                  \u0027%(project)s\u0027), {\u0027project\u0027: project_id})"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_23347ff9","line":1408,"updated":"2015-09-22 12:32:50.000000000","message":"Doesn\u0027t it change behaviour, as you are suppressing exception in this case?","commit_id":"44643767f44000958bd5aa55d0d1d948c6d4d107"},{"author":{"_account_id":14819,"name":"Timofey Durakov","email":"timofei.nd@gmail.com","username":"tdurakov"},"change_message_id":"87c16bacfb0944545f0b0bbb71d530e09bda3fd0","unresolved":false,"context_lines":[{"line_number":1405,"context_line":"        # list_floatingips will be raised."},{"line_number":1406,"context_line":"        except neutron_client_exc.NeutronClientException as e:"},{"line_number":1407,"context_line":"            if e.status_code \u003d\u003d 404:"},{"line_number":1408,"context_line":"                return []"},{"line_number":1409,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":1410,"context_line":"                LOG.exception(_LE(\u0027Unable to access floating IPs for project \u0027"},{"line_number":1411,"context_line":"                                  \u0027%(project)s\u0027), {\u0027project\u0027: project_id})"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_517852c4","line":1408,"in_reply_to":"ba15a1d1_1f68ab86","updated":"2015-09-22 15:08:23.000000000","message":"Alexey, while I think that the whole idea with the patch is OK, the problem here that you are changing behaviour, by suppressing exception.  Why you are not returning empty list in _get_floating_ip_by_address then? get_floating_ips_by_project is used by Nova API, so this at least API impact. If you are totally confident that this change is needed, move it to a separate patch, please.","commit_id":"44643767f44000958bd5aa55d0d1d948c6d4d107"},{"author":{"_account_id":11061,"name":"Alexey I. Froloff","email":"raorn@raorn.name","username":"raorn"},"change_message_id":"1674694de4723acc0d02733cca126a7eec701f47","unresolved":false,"context_lines":[{"line_number":1405,"context_line":"        # list_floatingips will be raised."},{"line_number":1406,"context_line":"        except neutron_client_exc.NeutronClientException as e:"},{"line_number":1407,"context_line":"            if e.status_code \u003d\u003d 404:"},{"line_number":1408,"context_line":"                return []"},{"line_number":1409,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":1410,"context_line":"                LOG.exception(_LE(\u0027Unable to access floating IPs for project \u0027"},{"line_number":1411,"context_line":"                                  \u0027%(project)s\u0027), {\u0027project\u0027: project_id})"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_1f68ab86","line":1408,"in_reply_to":"ba15a1d1_23347ff9","updated":"2015-09-22 13:10:57.000000000","message":"404 error from Neutron means L3 support turned off and there are no floating IPs for a given project - empty list is returned.  OTOH, in the code below no floating IPs generates error, and same error generated when L3 support disabled.\n\nIf floating_ips extension disabled in Nova, \"GET /os-floating-ips\" (index() methid) returns 404 Error.  Is 404 Error correct when Nova extension enabled, but Neutron extension disabled?","commit_id":"44643767f44000958bd5aa55d0d1d948c6d4d107"},{"author":{"_account_id":11061,"name":"Alexey I. Froloff","email":"raorn@raorn.name","username":"raorn"},"change_message_id":"b7b05b778d76b758d3d4253a3e6ebda2debce4e8","unresolved":false,"context_lines":[{"line_number":1405,"context_line":"        # list_floatingips will be raised."},{"line_number":1406,"context_line":"        except neutron_client_exc.NeutronClientException as e:"},{"line_number":1407,"context_line":"            if e.status_code \u003d\u003d 404:"},{"line_number":1408,"context_line":"                return []"},{"line_number":1409,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":1410,"context_line":"                LOG.exception(_LE(\u0027Unable to access floating IPs for project \u0027"},{"line_number":1411,"context_line":"                                  \u0027%(project)s\u0027), {\u0027project\u0027: project_id})"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_c3633940","line":1408,"in_reply_to":"ba15a1d1_517852c4","updated":"2015-09-22 15:22:03.000000000","message":"Because empty floatingip list in _get_floating_ip_by_address will raise exception (\"if len(fips) \u003d\u003d 0\" line).  And in _get_floating_ips_by_fixed_and_port 404 Error from Neutron results in returning empty list.\n\nOnce again - index method in FloatingIPController does not expect errors.","commit_id":"44643767f44000958bd5aa55d0d1d948c6d4d107"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c01850d6b54c6ca892407fd947b032bf7ba4e547","unresolved":false,"context_lines":[{"line_number":1490,"context_line":""},{"line_number":1491,"context_line":"    def _get_floating_ips_by_fixed_and_port(self, client, fixed_ip, port):"},{"line_number":1492,"context_line":"        \"\"\"Get floatingips from fixed ip and port.\"\"\""},{"line_number":1493,"context_line":"        try:"},{"line_number":1494,"context_line":"            data \u003d client.list_floatingips(fixed_ip_address\u003dfixed_ip,"},{"line_number":1495,"context_line":"                                           port_id\u003dport)"},{"line_number":1496,"context_line":"        # If a neutron plugin does not implement the L3 API a 404 from"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a2fa921_ef1d2c67","line":1493,"updated":"2015-10-06 15:40:18.000000000","message":"Pull this out into a private helper method that does the error handling and then re-use that in the other 2 places this is called rather than copy/paste all of this code.","commit_id":"ac6e51f726ee95cbd60b1276b0fb6c1d31e60c89"},{"author":{"_account_id":16839,"name":"Cale Rath","email":"ctrath@us.ibm.com","username":"ctrath"},"change_message_id":"dd32c7bde56c4c0ff68c86896c74bca43c2b84db","unresolved":false,"context_lines":[{"line_number":1476,"context_line":"        \"\"\"Get floatingip from floating ip address.\"\"\""},{"line_number":1477,"context_line":"        if not address:"},{"line_number":1478,"context_line":"            raise exception.FloatingIpNotFoundForAddress(address\u003daddress)"},{"line_number":1479,"context_line":"        fips \u003d _safe_get_floating_ips(floating_ip_address\u003daddress)"},{"line_number":1480,"context_line":"        if len(fips) \u003d\u003d 0:"},{"line_number":1481,"context_line":"            raise exception.FloatingIpNotFoundForAddress(address\u003daddress)"},{"line_number":1482,"context_line":"        elif len(fips) \u003e 1:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a2fa921_859489e2","line":1479,"updated":"2015-10-06 21:43:47.000000000","message":"Don\u0027t you need to pass the client arg to _safe_get_floating_ips(...)?","commit_id":"015d9c767c7b8fb73ad03676f6cf6ea703807d17"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"47997e7d4cfa73e80316ab91e62984b068a8a142","unresolved":false,"context_lines":[{"line_number":1470,"context_line":"                LOG.exception(_LE(\u0027Unable to access floating IP for %s\u0027),"},{"line_number":1471,"context_line":"                        \u0027, \u0027.join([\u0027%s %s\u0027 % (k, v)"},{"line_number":1472,"context_line":"                                   for k, v in kwargs.iteritems()]))"},{"line_number":1473,"context_line":"        return data[\u0027floatingips\u0027]"},{"line_number":1474,"context_line":""},{"line_number":1475,"context_line":"    def _get_floating_ip_by_address(self, client, address):"},{"line_number":1476,"context_line":"        \"\"\"Get floatingip from floating ip address.\"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"7a2fa921_c5efc885","line":1473,"updated":"2015-10-07 12:26:46.000000000","message":"Syntactically \u0027data\u0027 is local of block try .. except and so \u0027data\u0027 is not initialized if list_floatingips() is raising an exception.\n\nThis return should be inside block try .. except.","commit_id":"b40dd154cf137397e8db0771ea5239144bb20fc2"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"2aa0f19bc422326ec8c3a43362fc2ad503cd9768","unresolved":false,"context_lines":[{"line_number":1400,"context_line":"        client \u003d get_client(context)"},{"line_number":1401,"context_line":"        project_id \u003d context.project_id"},{"line_number":1402,"context_line":"        fips \u003d self._safe_get_floating_ips(client, tenant_id\u003dproject_id)"},{"line_number":1403,"context_line":"        if not fips:"},{"line_number":1404,"context_line":"            return []"},{"line_number":1405,"context_line":"        pool_dict \u003d self._setup_pools_dict(client)"},{"line_number":1406,"context_line":"        port_dict \u003d self._setup_ports_dict(client, project_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a2fa921_2e221053","line":1403,"updated":"2015-10-07 16:12:05.000000000","message":"I\u0027m not sure fips can be None here, it will be at least an empty list. So that check is probably not necessary, right?","commit_id":"1ab47e3ae5e127eba0ebc35bc9829d5f83012538"},{"author":{"_account_id":11061,"name":"Alexey I. Froloff","email":"raorn@raorn.name","username":"raorn"},"change_message_id":"57560a14858ca0a5e4a939a9bab74d7d341731ba","unresolved":false,"context_lines":[{"line_number":1400,"context_line":"        client \u003d get_client(context)"},{"line_number":1401,"context_line":"        project_id \u003d context.project_id"},{"line_number":1402,"context_line":"        fips \u003d self._safe_get_floating_ips(client, tenant_id\u003dproject_id)"},{"line_number":1403,"context_line":"        if not fips:"},{"line_number":1404,"context_line":"            return []"},{"line_number":1405,"context_line":"        pool_dict \u003d self._setup_pools_dict(client)"},{"line_number":1406,"context_line":"        port_dict \u003d self._setup_ports_dict(client, project_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a2fa921_16df2a6a","line":1403,"in_reply_to":"7a2fa921_1643aa43","updated":"2015-10-07 16:53:35.000000000","message":"http://logs.openstack.org/74/226274/5/check/gate-nova-python27/bc392a7/","commit_id":"1ab47e3ae5e127eba0ebc35bc9829d5f83012538"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"469547bb5c06d79533106d8f6fc21cb2725409d2","unresolved":false,"context_lines":[{"line_number":1400,"context_line":"        client \u003d get_client(context)"},{"line_number":1401,"context_line":"        project_id \u003d context.project_id"},{"line_number":1402,"context_line":"        fips \u003d self._safe_get_floating_ips(client, tenant_id\u003dproject_id)"},{"line_number":1403,"context_line":"        if not fips:"},{"line_number":1404,"context_line":"            return []"},{"line_number":1405,"context_line":"        pool_dict \u003d self._setup_pools_dict(client)"},{"line_number":1406,"context_line":"        port_dict \u003d self._setup_ports_dict(client, project_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a2fa921_037fc615","line":1403,"in_reply_to":"7a2fa921_16df2a6a","updated":"2015-10-08 11:15:27.000000000","message":"Yes you are right, thanks.","commit_id":"1ab47e3ae5e127eba0ebc35bc9829d5f83012538"},{"author":{"_account_id":11061,"name":"Alexey I. Froloff","email":"raorn@raorn.name","username":"raorn"},"change_message_id":"bf687e5df715df86a81a7c1c06ee281b82ac0036","unresolved":false,"context_lines":[{"line_number":1400,"context_line":"        client \u003d get_client(context)"},{"line_number":1401,"context_line":"        project_id \u003d context.project_id"},{"line_number":1402,"context_line":"        fips \u003d self._safe_get_floating_ips(client, tenant_id\u003dproject_id)"},{"line_number":1403,"context_line":"        if not fips:"},{"line_number":1404,"context_line":"            return []"},{"line_number":1405,"context_line":"        pool_dict \u003d self._setup_pools_dict(client)"},{"line_number":1406,"context_line":"        port_dict \u003d self._setup_ports_dict(client, project_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a2fa921_1643aa43","line":1403,"in_reply_to":"7a2fa921_2e221053","updated":"2015-10-07 16:51:56.000000000","message":"If fips list is empty, there\u0027s no need to setup pool and port dicts.  Look at Patch Set 5 test results - test fails because of unexpected (and redundant) calls.","commit_id":"1ab47e3ae5e127eba0ebc35bc9829d5f83012538"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b75575d4d8d3bf7042d4a22c1b51d0aff3067877","unresolved":false,"context_lines":[{"line_number":1400,"context_line":"        client \u003d get_client(context)"},{"line_number":1401,"context_line":"        project_id \u003d context.project_id"},{"line_number":1402,"context_line":"        fips \u003d self._safe_get_floating_ips(client, tenant_id\u003dproject_id)"},{"line_number":1403,"context_line":"        if not fips:"},{"line_number":1404,"context_line":"            return []"},{"line_number":1405,"context_line":"        pool_dict \u003d self._setup_pools_dict(client)"},{"line_number":1406,"context_line":"        port_dict \u003d self._setup_ports_dict(client, project_id)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a2fa921_0629d19d","line":1403,"updated":"2015-10-09 14:28:12.000000000","message":"Is this checking for a case were fips is None?  Because in your private method if you get a 404 then you already return [].  Or is this to just avoid setting up the pool and port dicts?","commit_id":"5ef4e58bcd6c664a764be0c25465caa714348403"},{"author":{"_account_id":11061,"name":"Alexey I. Froloff","email":"raorn@raorn.name","username":"raorn"},"change_message_id":"954f223eb0596fdffeeaf3c9e18bedebb70766c2","unresolved":false,"context_lines":[{"line_number":1400,"context_line":"        client \u003d get_client(context)"},{"line_number":1401,"context_line":"        project_id \u003d context.project_id"},{"line_number":1402,"context_line":"        fips \u003d self._safe_get_floating_ips(client, tenant_id\u003dproject_id)"},{"line_number":1403,"context_line":"        if not fips:"},{"line_number":1404,"context_line":"            return []"},{"line_number":1405,"context_line":"        pool_dict \u003d self._setup_pools_dict(client)"},{"line_number":1406,"context_line":"        port_dict \u003d self._setup_ports_dict(client, project_id)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a2fa921_7c15b899","line":1403,"in_reply_to":"7a2fa921_0629d19d","updated":"2015-10-09 15:13:18.000000000","message":"To avoid setting up the pool.  Otherwise tests fail with \"unexpected call\" error.","commit_id":"5ef4e58bcd6c664a764be0c25465caa714348403"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b75575d4d8d3bf7042d4a22c1b51d0aff3067877","unresolved":false,"context_lines":[{"line_number":1463,"context_line":"        \"\"\"Get floatingip gracefully handling 404 from Neutron.\"\"\""},{"line_number":1464,"context_line":"        try:"},{"line_number":1465,"context_line":"            return client.list_floatingips(**kwargs)[\u0027floatingips\u0027]"},{"line_number":1466,"context_line":"        # If a neutron plugin does not implement the L3 API a 404 from"},{"line_number":1467,"context_line":"        # list_floatingips will be raised."},{"line_number":1468,"context_line":"        except neutron_client_exc.NeutronClientException as e:"},{"line_number":1469,"context_line":"            if e.status_code \u003d\u003d 404:"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a2fa921_b91cc26a","line":1466,"updated":"2015-10-09 14:28:12.000000000","message":"Is there any way to tell this from the neutron API, like by listing enabled extensions (discovery?) or something in the network model?","commit_id":"5ef4e58bcd6c664a764be0c25465caa714348403"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"421ffd08461909193658860b60ee946db5d04469","unresolved":false,"context_lines":[{"line_number":1463,"context_line":"        \"\"\"Get floatingip gracefully handling 404 from Neutron.\"\"\""},{"line_number":1464,"context_line":"        try:"},{"line_number":1465,"context_line":"            return client.list_floatingips(**kwargs)[\u0027floatingips\u0027]"},{"line_number":1466,"context_line":"        # If a neutron plugin does not implement the L3 API a 404 from"},{"line_number":1467,"context_line":"        # list_floatingips will be raised."},{"line_number":1468,"context_line":"        except neutron_client_exc.NeutronClientException as e:"},{"line_number":1469,"context_line":"            if e.status_code \u003d\u003d 404:"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a2fa921_b90a7424","line":1466,"in_reply_to":"7a2fa921_72295f89","updated":"2015-10-09 19:32:40.000000000","message":"It would definitely be a separate change to add this checking so I\u0027m fine with not doing anything for that here.","commit_id":"5ef4e58bcd6c664a764be0c25465caa714348403"},{"author":{"_account_id":11061,"name":"Alexey I. Froloff","email":"raorn@raorn.name","username":"raorn"},"change_message_id":"954f223eb0596fdffeeaf3c9e18bedebb70766c2","unresolved":false,"context_lines":[{"line_number":1463,"context_line":"        \"\"\"Get floatingip gracefully handling 404 from Neutron.\"\"\""},{"line_number":1464,"context_line":"        try:"},{"line_number":1465,"context_line":"            return client.list_floatingips(**kwargs)[\u0027floatingips\u0027]"},{"line_number":1466,"context_line":"        # If a neutron plugin does not implement the L3 API a 404 from"},{"line_number":1467,"context_line":"        # list_floatingips will be raised."},{"line_number":1468,"context_line":"        except neutron_client_exc.NeutronClientException as e:"},{"line_number":1469,"context_line":"            if e.status_code \u003d\u003d 404:"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a2fa921_72295f89","line":1466,"in_reply_to":"7a2fa921_b91cc26a","updated":"2015-10-09 15:13:18.000000000","message":"Yes, but.  \u0027floatingips\u0027 resource is a part of L3 extension with alias \u0027router\u0027.  I don\u0027t think that it should be harcoded in that way...  404 Error for \u0027list\u0027 action is a good indicator, that resource is not supported.","commit_id":"5ef4e58bcd6c664a764be0c25465caa714348403"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ad1a6ffa918f8430747f10feb2cb970a9741ecd4","unresolved":false,"context_lines":[{"line_number":1465,"context_line":"            return client.list_floatingips(**kwargs)[\u0027floatingips\u0027]"},{"line_number":1466,"context_line":"        # If a neutron plugin does not implement the L3 API a 404 from"},{"line_number":1467,"context_line":"        # list_floatingips will be raised."},{"line_number":1468,"context_line":"        except neutron_client_exc.NeutronClientException as e:"},{"line_number":1469,"context_line":"            if e.status_code \u003d\u003d 404:"},{"line_number":1470,"context_line":"                return []"},{"line_number":1471,"context_line":"            with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a2fa921_197616d7","line":1468,"updated":"2015-10-09 14:32:21.000000000","message":"Given there is a neutron_client_exc.NotFound exception, I feel this code could be cleaner if we just handled that and returned []:\n\nhttps://github.com/openstack/python-neutronclient/blob/master/neutronclient/common/exceptions.py#L87\n\nThen we don\u0027t need the with excutils context and logging in here.","commit_id":"5ef4e58bcd6c664a764be0c25465caa714348403"},{"author":{"_account_id":11061,"name":"Alexey I. Froloff","email":"raorn@raorn.name","username":"raorn"},"change_message_id":"954f223eb0596fdffeeaf3c9e18bedebb70766c2","unresolved":false,"context_lines":[{"line_number":1465,"context_line":"            return client.list_floatingips(**kwargs)[\u0027floatingips\u0027]"},{"line_number":1466,"context_line":"        # If a neutron plugin does not implement the L3 API a 404 from"},{"line_number":1467,"context_line":"        # list_floatingips will be raised."},{"line_number":1468,"context_line":"        except neutron_client_exc.NeutronClientException as e:"},{"line_number":1469,"context_line":"            if e.status_code \u003d\u003d 404:"},{"line_number":1470,"context_line":"                return []"},{"line_number":1471,"context_line":"            with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a2fa921_7766312b","line":1468,"in_reply_to":"7a2fa921_197616d7","updated":"2015-10-09 15:13:18.000000000","message":"Tests uses NeutronClientException with specific status_code, and there will be failure because NeutronClientException(status_code\u003d404) and NotFound() are not the same.","commit_id":"5ef4e58bcd6c664a764be0c25465caa714348403"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"421ffd08461909193658860b60ee946db5d04469","unresolved":false,"context_lines":[{"line_number":1465,"context_line":"            return client.list_floatingips(**kwargs)[\u0027floatingips\u0027]"},{"line_number":1466,"context_line":"        # If a neutron plugin does not implement the L3 API a 404 from"},{"line_number":1467,"context_line":"        # list_floatingips will be raised."},{"line_number":1468,"context_line":"        except neutron_client_exc.NeutronClientException as e:"},{"line_number":1469,"context_line":"            if e.status_code \u003d\u003d 404:"},{"line_number":1470,"context_line":"                return []"},{"line_number":1471,"context_line":"            with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a2fa921_fc0a1a1f","line":1468,"in_reply_to":"7a2fa921_7766312b","updated":"2015-10-09 19:32:40.000000000","message":"Well, the unit tests are doing this because they had to before neutronclient had the NotFound exception type, I don\u0027t see why we can\u0027t change this and adjust the unit tests as needed.","commit_id":"5ef4e58bcd6c664a764be0c25465caa714348403"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b75575d4d8d3bf7042d4a22c1b51d0aff3067877","unresolved":false,"context_lines":[{"line_number":1470,"context_line":"                return []"},{"line_number":1471,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":1472,"context_line":"                LOG.exception(_LE(\u0027Unable to access floating IP for %s\u0027),"},{"line_number":1473,"context_line":"                        \u0027, \u0027.join([\u0027%s %s\u0027 % (k, v)"},{"line_number":1474,"context_line":"                                   for k, v in six.iteritems(kwargs)]))"},{"line_number":1475,"context_line":""},{"line_number":1476,"context_line":"    def _get_floating_ip_by_address(self, client, address):"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a2fa921_f9e0fa2a","line":1473,"updated":"2015-10-09 14:28:12.000000000","message":"I\u0027m not sure I like this but I can\u0027t really think of a better alternative to provide details in a generic way.","commit_id":"5ef4e58bcd6c664a764be0c25465caa714348403"},{"author":{"_account_id":11061,"name":"Alexey I. Froloff","email":"raorn@raorn.name","username":"raorn"},"change_message_id":"dc5623b54142dc0c639d7f515e855990e0027028","unresolved":false,"context_lines":[{"line_number":1470,"context_line":"                return []"},{"line_number":1471,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":1472,"context_line":"                LOG.exception(_LE(\u0027Unable to access floating IP for %s\u0027),"},{"line_number":1473,"context_line":"                        \u0027, \u0027.join([\u0027%s %s\u0027 % (k, v)"},{"line_number":1474,"context_line":"                                   for k, v in six.iteritems(kwargs)]))"},{"line_number":1475,"context_line":""},{"line_number":1476,"context_line":"    def _get_floating_ip_by_address(self, client, address):"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a2ca52d_c02118b6","line":1473,"in_reply_to":"7a2fa921_f9e0fa2a","updated":"2015-10-14 13:31:10.000000000","message":"I could just remove this logging.  Like:\n\n        try:\n            return client.list_floatingips(**kwargs)[\u0027floatingips\u0027]\n        except neutron_client_exc.NotFound:\n            return []","commit_id":"5ef4e58bcd6c664a764be0c25465caa714348403"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3e3eae0700b5bad6205bd2e19bca406788a4bde2","unresolved":false,"context_lines":[{"line_number":1468,"context_line":"        # list_floatingips will be raised."},{"line_number":1469,"context_line":"        except neutron_client_exc.NotFound:"},{"line_number":1470,"context_line":"            return []"},{"line_number":1471,"context_line":"        except Exception:"},{"line_number":1472,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":1473,"context_line":"                LOG.exception(_LE(\u0027Unable to access floating IP for %s\u0027),"},{"line_number":1474,"context_line":"                        \u0027, \u0027.join([\u0027%s %s\u0027 % (k, v)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a2ca52d_d99d4567","line":1471,"updated":"2015-10-15 21:41:19.000000000","message":"I think you still want the more specific NeutronClientException here.","commit_id":"1ce7f8d71b77f8fc765e1e6de25b6465959c23e3"}],"nova/tests/unit/network/test_neutronv2.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b75575d4d8d3bf7042d4a22c1b51d0aff3067877","unresolved":false,"context_lines":[{"line_number":1996,"context_line":"                          api.get_floating_ip_by_address,"},{"line_number":1997,"context_line":"                          self.context, address)"},{"line_number":1998,"context_line":""},{"line_number":1999,"context_line":"    def test_get_floating_ip_by_address_not_found_neutron_not_found(self):"},{"line_number":2000,"context_line":"        api \u003d neutronapi.API()"},{"line_number":2001,"context_line":"        NeutronNotFound \u003d exceptions.NeutronClientException(status_code\u003d404)"},{"line_number":2002,"context_line":"        address \u003d self.fip_unassociated[\u0027floating_ip_address\u0027]"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a2fa921_998ea62c","line":1999,"updated":"2015-10-09 14:28:12.000000000","message":"Can we move these tests under TestNeutronv2WithMock and use mock instead of mox?  We\u0027ve been trying to not add new tests to the existing TestNeutronv2 class because (1) we want new tests to use mock and (2) TestNeutronv2 has all of the gross mox stubbing that happens in setup for each test run.","commit_id":"5ef4e58bcd6c664a764be0c25465caa714348403"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"421ffd08461909193658860b60ee946db5d04469","unresolved":false,"context_lines":[{"line_number":1996,"context_line":"                          api.get_floating_ip_by_address,"},{"line_number":1997,"context_line":"                          self.context, address)"},{"line_number":1998,"context_line":""},{"line_number":1999,"context_line":"    def test_get_floating_ip_by_address_not_found_neutron_not_found(self):"},{"line_number":2000,"context_line":"        api \u003d neutronapi.API()"},{"line_number":2001,"context_line":"        NeutronNotFound \u003d exceptions.NeutronClientException(status_code\u003d404)"},{"line_number":2002,"context_line":"        address \u003d self.fip_unassociated[\u0027floating_ip_address\u0027]"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a2fa921_dc1e3e5e","line":1999,"in_reply_to":"7a2fa921_92ef5b1d","updated":"2015-10-09 19:32:40.000000000","message":"These tests aren\u0027t very big, you don\u0027t need to move the existing tests, just write the same test using mock and do it in TestNeutronv2WithMock.","commit_id":"5ef4e58bcd6c664a764be0c25465caa714348403"},{"author":{"_account_id":11061,"name":"Alexey I. Froloff","email":"raorn@raorn.name","username":"raorn"},"change_message_id":"954f223eb0596fdffeeaf3c9e18bedebb70766c2","unresolved":false,"context_lines":[{"line_number":1996,"context_line":"                          api.get_floating_ip_by_address,"},{"line_number":1997,"context_line":"                          self.context, address)"},{"line_number":1998,"context_line":""},{"line_number":1999,"context_line":"    def test_get_floating_ip_by_address_not_found_neutron_not_found(self):"},{"line_number":2000,"context_line":"        api \u003d neutronapi.API()"},{"line_number":2001,"context_line":"        NeutronNotFound \u003d exceptions.NeutronClientException(status_code\u003d404)"},{"line_number":2002,"context_line":"        address \u003d self.fip_unassociated[\u0027floating_ip_address\u0027]"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a2fa921_92ef5b1d","line":1999,"in_reply_to":"7a2fa921_998ea62c","updated":"2015-10-09 15:13:18.000000000","message":"I just copy-pasted similar tests.  Shouldn\u0027t it also be moved?  Shouldn\u0027t it be different patch that does code refactoring?","commit_id":"5ef4e58bcd6c664a764be0c25465caa714348403"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b75575d4d8d3bf7042d4a22c1b51d0aff3067877","unresolved":false,"context_lines":[{"line_number":2009,"context_line":""},{"line_number":2010,"context_line":"    def test_get_floating_ip_by_address_not_found_neutron_raises_non404(self):"},{"line_number":2011,"context_line":"        api \u003d neutronapi.API()"},{"line_number":2012,"context_line":"        NeutronNotFound \u003d exceptions.NeutronClientException(status_code\u003d0)"},{"line_number":2013,"context_line":"        address \u003d self.fip_unassociated[\u0027floating_ip_address\u0027]"},{"line_number":2014,"context_line":"        self.moxed_client.list_floatingips(floating_ip_address\u003daddress).\\"},{"line_number":2015,"context_line":"            AndRaise(NeutronNotFound)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a2fa921_993226a6","line":2012,"updated":"2015-10-09 14:28:12.000000000","message":"status_code\u003d500 would be better here.","commit_id":"5ef4e58bcd6c664a764be0c25465caa714348403"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"421ffd08461909193658860b60ee946db5d04469","unresolved":false,"context_lines":[{"line_number":2009,"context_line":""},{"line_number":2010,"context_line":"    def test_get_floating_ip_by_address_not_found_neutron_raises_non404(self):"},{"line_number":2011,"context_line":"        api \u003d neutronapi.API()"},{"line_number":2012,"context_line":"        NeutronNotFound \u003d exceptions.NeutronClientException(status_code\u003d0)"},{"line_number":2013,"context_line":"        address \u003d self.fip_unassociated[\u0027floating_ip_address\u0027]"},{"line_number":2014,"context_line":"        self.moxed_client.list_floatingips(floating_ip_address\u003daddress).\\"},{"line_number":2015,"context_line":"            AndRaise(NeutronNotFound)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a2fa921_7c2e0a8d","line":2012,"in_reply_to":"7a2fa921_72ecff29","updated":"2015-10-09 19:32:40.000000000","message":"It doesn\u0027t matter, 0 is not a valid status code.  I realize the point is that if it\u0027s not 404 you get the exception back, but the tests should not be blatantly made up.","commit_id":"5ef4e58bcd6c664a764be0c25465caa714348403"},{"author":{"_account_id":11061,"name":"Alexey I. Froloff","email":"raorn@raorn.name","username":"raorn"},"change_message_id":"954f223eb0596fdffeeaf3c9e18bedebb70766c2","unresolved":false,"context_lines":[{"line_number":2009,"context_line":""},{"line_number":2010,"context_line":"    def test_get_floating_ip_by_address_not_found_neutron_raises_non404(self):"},{"line_number":2011,"context_line":"        api \u003d neutronapi.API()"},{"line_number":2012,"context_line":"        NeutronNotFound \u003d exceptions.NeutronClientException(status_code\u003d0)"},{"line_number":2013,"context_line":"        address \u003d self.fip_unassociated[\u0027floating_ip_address\u0027]"},{"line_number":2014,"context_line":"        self.moxed_client.list_floatingips(floating_ip_address\u003daddress).\\"},{"line_number":2015,"context_line":"            AndRaise(NeutronNotFound)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a2fa921_72ecff29","line":2012,"in_reply_to":"7a2fa921_993226a6","updated":"2015-10-09 15:13:18.000000000","message":"Same as above - copy-paste from similar test.","commit_id":"5ef4e58bcd6c664a764be0c25465caa714348403"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b75575d4d8d3bf7042d4a22c1b51d0aff3067877","unresolved":false,"context_lines":[{"line_number":2068,"context_line":"        fips \u003d api.get_floating_ips_by_project(self.context)"},{"line_number":2069,"context_line":"        self.assertEqual(expected, fips)"},{"line_number":2070,"context_line":""},{"line_number":2071,"context_line":"    def test_get_floating_ips_by_project_not_found(self):"},{"line_number":2072,"context_line":"        api \u003d neutronapi.API()"},{"line_number":2073,"context_line":"        NeutronNotFound \u003d exceptions.NeutronClientException(status_code\u003d404)"},{"line_number":2074,"context_line":"        project_id \u003d self.context.project_id"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a2fa921_f9cd5a66","line":2071,"updated":"2015-10-09 14:28:12.000000000","message":"Same - move under TestNeutronv2WithMock and use mock rather than mox.\n\nYou could also technically mock out _setup_pools_dict and assert that it\u0027s not called.","commit_id":"5ef4e58bcd6c664a764be0c25465caa714348403"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b75575d4d8d3bf7042d4a22c1b51d0aff3067877","unresolved":false,"context_lines":[{"line_number":2082,"context_line":""},{"line_number":2083,"context_line":"    def test_get_floating_ips_by_project_raises_non404(self):"},{"line_number":2084,"context_line":"        api \u003d neutronapi.API()"},{"line_number":2085,"context_line":"        NeutronNotFound \u003d exceptions.NeutronClientException(status_code\u003d0)"},{"line_number":2086,"context_line":"        project_id \u003d self.context.project_id"},{"line_number":2087,"context_line":"        self.moxed_client.list_floatingips(tenant_id\u003dproject_id).\\"},{"line_number":2088,"context_line":"            AndRaise(NeutronNotFound)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a2fa921_d9be5ead","line":2085,"updated":"2015-10-09 14:28:12.000000000","message":"Use 500.","commit_id":"5ef4e58bcd6c664a764be0c25465caa714348403"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3e3eae0700b5bad6205bd2e19bca406788a4bde2","unresolved":false,"context_lines":[{"line_number":3564,"context_line":"                                                                mock_ntrn):"},{"line_number":3565,"context_line":"        mock_nc \u003d mock.Mock()"},{"line_number":3566,"context_line":"        mock_ntrn.return_value \u003d mock_nc"},{"line_number":3567,"context_line":"        NeutronError \u003d exceptions.NotFound()"},{"line_number":3568,"context_line":"        mock_nc.list_floatingips.side_effect \u003d NeutronError"},{"line_number":3569,"context_line":"        address \u003d \u0027172.24.4.227\u0027"},{"line_number":3570,"context_line":"        self.assertRaises(exception.FloatingIpNotFoundForAddress,"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a2ca52d_b9bde9b8","line":3567,"updated":"2015-10-15 21:41:19.000000000","message":"Please don\u0027t use caps for a local variable like this, you probably don\u0027t even need a separate variable for it.","commit_id":"1ce7f8d71b77f8fc765e1e6de25b6465959c23e3"}]}
