)]}'
{"nova/network/neutronv2/api.py":[{"author":{"_account_id":5292,"name":"Christopher Yeoh","email":"cbkyeoh@gmail.com","username":"cyeoh-0"},"change_message_id":"8ae1b4952c183ffc73a465e53cba73516ec6a1cd","unresolved":false,"context_lines":[{"line_number":636,"context_line":"                            network_uuid\u003dnet[\u0027id\u0027])"},{"line_number":637,"context_line":""},{"line_number":638,"context_line":"                if len(nets) !\u003d len(net_ids_requested):"},{"line_number":639,"context_line":"                    requsted_netid_set \u003d set(net_ids_requested)"},{"line_number":640,"context_line":"                    returned_netid_set \u003d set([net[\u0027id\u0027] for net in nets])"},{"line_number":641,"context_line":"                    lostid_set \u003d requsted_netid_set - returned_netid_set"},{"line_number":642,"context_line":"                    id_str \u003d \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F%2F6wM%3D","line":639,"updated":"2014-03-12 23:29:56.000000000","message":"while you\u0027re changing the code here anyway, perhaps fix the requsted_netid_set typo to \"requested_netid_set\"?","commit_id":"f8e7cd4af5c984c903a1a2514203197bc3c39c6b"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"bb8b3965b22f635d3e50f9162a1cd1534f5a64c9","unresolved":false,"context_lines":[{"line_number":636,"context_line":"                            network_uuid\u003dnet[\u0027id\u0027])"},{"line_number":637,"context_line":""},{"line_number":638,"context_line":"                if len(nets) !\u003d len(net_ids_requested):"},{"line_number":639,"context_line":"                    requsted_netid_set \u003d set(net_ids_requested)"},{"line_number":640,"context_line":"                    returned_netid_set \u003d set([net[\u0027id\u0027] for net in nets])"},{"line_number":641,"context_line":"                    lostid_set \u003d requsted_netid_set - returned_netid_set"},{"line_number":642,"context_line":"                    id_str \u003d \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F%2F5Hg%3D","line":639,"in_reply_to":"AAAAWH%2F%2F6wM%3D","updated":"2014-03-13 05:08:42.000000000","message":"Done","commit_id":"f8e7cd4af5c984c903a1a2514203197bc3c39c6b"},{"author":{"_account_id":5292,"name":"Christopher Yeoh","email":"cbkyeoh@gmail.com","username":"cyeoh-0"},"change_message_id":"3f0b0347f32caf66189cc557ea2e5d669e15b708","unresolved":false,"context_lines":[{"line_number":615,"context_line":"                        raise exception.PortInUse(port_id\u003dport_id)"},{"line_number":616,"context_line":"                    if not port.get(\u0027fixed_ips\u0027):"},{"line_number":617,"context_line":"                        raise exception.PortRequiresFixedIP(port_id\u003dport_id)"},{"line_number":618,"context_line":"                    net_id \u003d port[\u0027network_id\u0027]"},{"line_number":619,"context_line":"                else:"},{"line_number":620,"context_line":"                    ports_needed_per_instance +\u003d 1"},{"line_number":621,"context_line":"                    net_ids_requested.append(net_id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2FviQ%3D","line":618,"updated":"2014-03-14 03:34:05.000000000","message":"So I think this is probably something that should be addressed in a different patch if its a problem, but if net_id is supplied and it doesn\u0027t match port[\u0027network_id\u0027] should we be return a bad request to the user?","commit_id":"b34ec78dc27fa06b5dcf1c4b057416f0eeba9515"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"4b0cd5abf98c9858974ff311797213e9e75b331a","unresolved":false,"context_lines":[{"line_number":615,"context_line":"                        raise exception.PortInUse(port_id\u003dport_id)"},{"line_number":616,"context_line":"                    if not port.get(\u0027fixed_ips\u0027):"},{"line_number":617,"context_line":"                        raise exception.PortRequiresFixedIP(port_id\u003dport_id)"},{"line_number":618,"context_line":"                    net_id \u003d port[\u0027network_id\u0027]"},{"line_number":619,"context_line":"                else:"},{"line_number":620,"context_line":"                    ports_needed_per_instance +\u003d 1"},{"line_number":621,"context_line":"                    net_ids_requested.append(net_id)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2Fux4%3D","line":618,"in_reply_to":"AAAAWH%2F%2FviQ%3D","updated":"2014-03-14 06:25:52.000000000","message":"Requested_networks here is a list of tuples (network_uuid, fixed_ip, port_uuid). Each tuple maps to an interface on an instance. In this tuple you will either have a  (network_uuid, None/IP, None) or (None, None, port_uuid).  So to answer you\u0027re question net_id shouldn\u0027t match port[\u0027network_id\u0027] in fact we are actually enforcing this on line 624 as we do not want to allow an instance to have two interfaces on the same network. \n\nThe reason for this is because an instance could bridge those interfaces causes a loop in the network, in addition there isn\u0027t really a use case for having two interfaces attached to the same L2.","commit_id":"b34ec78dc27fa06b5dcf1c4b057416f0eeba9515"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ccbdbab5765a1f811ea7f07e96f557ed89788973","unresolved":false,"context_lines":[{"line_number":609,"context_line":"                         \"ID to be more specific.\")"},{"line_number":610,"context_line":"                raise exception.NetworkAmbiguous(msg)"},{"line_number":611,"context_line":"            else:"},{"line_number":612,"context_line":"                ports_needed_per_instance \u003d 1"},{"line_number":613,"context_line":""},{"line_number":614,"context_line":"        else:"},{"line_number":615,"context_line":"            instance_on_net_ids \u003d []"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAXH%2F%2FUzc%3D","line":612,"updated":"2014-04-22 14:18:57.000000000","message":"OK in this case there are no specific requested networks and only one network available (or zero? is that possible?).","commit_id":"94013bc66ef91e1911f8a9d2fd17cd630bcc9ad8"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"16d9d8fcac8834de8134fa9e1181c37f0d76cf4c","unresolved":false,"context_lines":[{"line_number":609,"context_line":"                         \"ID to be more specific.\")"},{"line_number":610,"context_line":"                raise exception.NetworkAmbiguous(msg)"},{"line_number":611,"context_line":"            else:"},{"line_number":612,"context_line":"                ports_needed_per_instance \u003d 1"},{"line_number":613,"context_line":""},{"line_number":614,"context_line":"        else:"},{"line_number":615,"context_line":"            instance_on_net_ids \u003d []"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad9bd40_475970fd","line":612,"in_reply_to":"AAAAXH%2F%2FUzc%3D","updated":"2014-05-02 00:34:39.000000000","message":"When you boot an instance if you do not specify any networks by default and if you only have 1 network it creates a port for you on that network (that\u0027s why this is set to one).\n\nIf you have more then one network and you don\u0027t specific any networks  nova-api raises an error.","commit_id":"94013bc66ef91e1911f8a9d2fd17cd630bcc9ad8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ccbdbab5765a1f811ea7f07e96f557ed89788973","unresolved":false,"context_lines":[{"line_number":615,"context_line":"            instance_on_net_ids \u003d []"},{"line_number":616,"context_line":"            net_ids_requested \u003d []"},{"line_number":617,"context_line":""},{"line_number":618,"context_line":"            for (net_id, _i, port_id) in requested_networks:"},{"line_number":619,"context_line":"                if port_id:"},{"line_number":620,"context_line":"                    try:"},{"line_number":621,"context_line":"                        port \u003d neutron.show_port(port_id).get(\u0027port\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAXH%2F%2FUys%3D","line":618,"updated":"2014-04-22 14:18:57.000000000","message":"What is _i?","commit_id":"94013bc66ef91e1911f8a9d2fd17cd630bcc9ad8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"533b43b6fe5cf8f358e1a50e62ea5878a00640d5","unresolved":false,"context_lines":[{"line_number":615,"context_line":"            instance_on_net_ids \u003d []"},{"line_number":616,"context_line":"            net_ids_requested \u003d []"},{"line_number":617,"context_line":""},{"line_number":618,"context_line":"            for (net_id, _i, port_id) in requested_networks:"},{"line_number":619,"context_line":"                if port_id:"},{"line_number":620,"context_line":"                    try:"},{"line_number":621,"context_line":"                        port \u003d neutron.show_port(port_id).get(\u0027port\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad9bd40_a09f7d5e","line":618,"in_reply_to":"9ad9bd40_87f9b8ca","updated":"2014-05-02 01:57:46.000000000","message":"Ah OK, makes sense...so I guess that use case isn\u0027t supported in here because I don\u0027t see that variable used at all?  We should at least rename that variable in another patch...","commit_id":"94013bc66ef91e1911f8a9d2fd17cd630bcc9ad8"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"16d9d8fcac8834de8134fa9e1181c37f0d76cf4c","unresolved":false,"context_lines":[{"line_number":615,"context_line":"            instance_on_net_ids \u003d []"},{"line_number":616,"context_line":"            net_ids_requested \u003d []"},{"line_number":617,"context_line":""},{"line_number":618,"context_line":"            for (net_id, _i, port_id) in requested_networks:"},{"line_number":619,"context_line":"                if port_id:"},{"line_number":620,"context_line":"                    try:"},{"line_number":621,"context_line":"                        port \u003d neutron.show_port(port_id).get(\u0027port\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad9bd40_87f9b8ca","line":618,"in_reply_to":"AAAAXH%2F%2FUys%3D","updated":"2014-05-02 00:34:39.000000000","message":"fixed_ip if the user wants to specify the ip on a port or network.","commit_id":"94013bc66ef91e1911f8a9d2fd17cd630bcc9ad8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ccbdbab5765a1f811ea7f07e96f557ed89788973","unresolved":false,"context_lines":[{"line_number":634,"context_line":"                        raise exception.PortRequiresFixedIP(port_id\u003dport_id)"},{"line_number":635,"context_line":"                    net_id \u003d port[\u0027network_id\u0027]"},{"line_number":636,"context_line":"                else:"},{"line_number":637,"context_line":"                    ports_needed_per_instance +\u003d 1"},{"line_number":638,"context_line":"                    net_ids_requested.append(net_id)"},{"line_number":639,"context_line":""},{"line_number":640,"context_line":"                if net_id in instance_on_net_ids:"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAXH%2F%2FUxg%3D","line":637,"updated":"2014-04-22 14:18:57.000000000","message":"Note to self, ports_needed_per_instance is incremented for each network requested.","commit_id":"94013bc66ef91e1911f8a9d2fd17cd630bcc9ad8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ccbdbab5765a1f811ea7f07e96f557ed89788973","unresolved":false,"context_lines":[{"line_number":665,"context_line":"        # network validation, but port creation requires some details"},{"line_number":666,"context_line":"        # from the hypervisor.  So we just check the quota and return"},{"line_number":667,"context_line":"        # how many of the requested number of instances can be created"},{"line_number":668,"context_line":"        if ports_needed_per_instance:"},{"line_number":669,"context_line":"            ports \u003d neutron.list_ports(tenant_id\u003dcontext.project_id)[\u0027ports\u0027]"},{"line_number":670,"context_line":"            quotas \u003d neutron.show_quota(tenant_id\u003dcontext.project_id)[\u0027quota\u0027]"},{"line_number":671,"context_line":"            if quotas.get(\u0027port\u0027) \u003d\u003d -1:"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAXH%2F%2FUtw%3D","line":668,"updated":"2014-04-22 14:18:57.000000000","message":"This is True if there are no requested_networks but there is a network available, from line 612, is that OK?  Should this also be checking instance_on_net_ids?  I might just be confused because requested_networks makes me think of just that, a specific requested network, but it could also be requesting a specific port that is on a specific network.\n\nIf there are requested_networks and there is a requested port in there, and there aren\u0027t additional duplicated requested networks in requested_networks, then ports_needed_per_instance is still 0 and we don\u0027t do this, which is the optimization.\n\nHowever, I don\u0027t see a test for the case that there are no requested_networks and that it gets to this point - there are some negative tests for ambiguous networks when requested_networks is None, but those don\u0027t get this far.","commit_id":"94013bc66ef91e1911f8a9d2fd17cd630bcc9ad8"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"16d9d8fcac8834de8134fa9e1181c37f0d76cf4c","unresolved":false,"context_lines":[{"line_number":665,"context_line":"        # network validation, but port creation requires some details"},{"line_number":666,"context_line":"        # from the hypervisor.  So we just check the quota and return"},{"line_number":667,"context_line":"        # how many of the requested number of instances can be created"},{"line_number":668,"context_line":"        if ports_needed_per_instance:"},{"line_number":669,"context_line":"            ports \u003d neutron.list_ports(tenant_id\u003dcontext.project_id)[\u0027ports\u0027]"},{"line_number":670,"context_line":"            quotas \u003d neutron.show_quota(tenant_id\u003dcontext.project_id)[\u0027quota\u0027]"},{"line_number":671,"context_line":"            if quotas.get(\u0027port\u0027) \u003d\u003d -1:"}],"source_content_type":"text/x-python","patch_set":10,"id":"9ad9bd40_d65fef0c","line":668,"in_reply_to":"AAAAXH%2F%2FUtw%3D","updated":"2014-05-02 00:34:39.000000000","message":"\u003eThis is True if there are no requested_networks but there is a network available, \u003efrom line 612, is that OK? Should this also be checking instance_on_net_ids? I \u003emight just be confused because requested_networks makes me think of just that, a \u003especific requested network, but it could also be requesting a specific port that is on \u003ea specific network.\n\nYup this is okay for the reason given on line 612 now. \n\n\u003eIf there are requested_networks and there is a requested port in there, and there \u003earen\u0027t additional duplicated requested networks in requested_networks, then \u003eports_needed_per_instance is still 0 and we don\u0027t do this, which is the \u003eoptimization.\n\nRight, Exactly.\n\n\n\u003eHowever, I don\u0027t see a test for the case that there are no requested_networks and \u003ethat it gets to this point - there are some negative tests for ambiguous networks \u003ewhen requested_networks is None, but those don\u0027t get this far. \n\nTest added.","commit_id":"94013bc66ef91e1911f8a9d2fd17cd630bcc9ad8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2b084dc09c088dff8c31fcddb0767771c269c92b","unresolved":false,"context_lines":[{"line_number":605,"context_line":"            instance_on_net_ids \u003d []"},{"line_number":606,"context_line":"            net_ids_requested \u003d []"},{"line_number":607,"context_line":""},{"line_number":608,"context_line":"            for (net_id, _i, port_id) in requested_networks:"},{"line_number":609,"context_line":"                if port_id:"},{"line_number":610,"context_line":"                    try:"},{"line_number":611,"context_line":"                        port \u003d neutron.show_port(port_id).get(\u0027port\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"9ad9bd40_c04641bf","line":608,"updated":"2014-05-02 02:08:26.000000000","message":"Side question, but why don\u0027t we do any validation with the fixed IP (_i variable) in this method regarding the port (if a port is specified)?\n\nI see it\u0027s available:\n\nhttp://docs.openstack.org/api/openstack-network/2.0/content/GET_os-ports-v2.0_showPort__v2.0_ports__port_id__ports.html#GET_os-ports-v2.0_showPort__v2.0_ports__port_id__ports-Request\n\nAnd also looking at this:\n\nhttps://review.openstack.org/#/c/79776/","commit_id":"6e5f6041a38ddb0b2643dff66d264f3594f1a875"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5dcb672802f618fd28ca02658fc3a73da287be4a","unresolved":false,"context_lines":[{"line_number":605,"context_line":"            instance_on_net_ids \u003d []"},{"line_number":606,"context_line":"            net_ids_requested \u003d []"},{"line_number":607,"context_line":""},{"line_number":608,"context_line":"            for (net_id, _i, port_id) in requested_networks:"},{"line_number":609,"context_line":"                if port_id:"},{"line_number":610,"context_line":"                    try:"},{"line_number":611,"context_line":"                        port \u003d neutron.show_port(port_id).get(\u0027port\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"9ad9bd40_408951ea","line":608,"in_reply_to":"9ad9bd40_c04641bf","updated":"2014-05-02 02:12:30.000000000","message":"Nevermind, Jim Carey is adding that validation in the other patch, exactly what I was looking for.","commit_id":"6e5f6041a38ddb0b2643dff66d264f3594f1a875"}],"nova/tests/network/test_neutronv2.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6acd900c06c5284efd05a1c4592f148576a2d48c","unresolved":false,"context_lines":[{"line_number":1340,"context_line":"                                          requested_networks, 2)"},{"line_number":1341,"context_line":"        self.assertEqual(max_count, 2)"},{"line_number":1342,"context_line":""},{"line_number":1343,"context_line":"    def test_validate_networks_no_quota_but_ports_supplied(self):"},{"line_number":1344,"context_line":"        # Test validation for a request for one instance needing"},{"line_number":1345,"context_line":"        # two ports, where the quota is 2 and 2 ports are in use"},{"line_number":1346,"context_line":"        # but the request includes a port to be used"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAWH%2F%2B54Q%3D","line":1343,"updated":"2014-03-21 20:09:53.000000000","message":"Shouldn\u0027t this docstring change now that the quota stuff isn\u0027t in play anymore?","commit_id":"c472bf131844f590dffc4c69f53bc34c5287bed0"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3f72de500d692850330cb6042afdc0aba3126acd","unresolved":false,"context_lines":[{"line_number":1340,"context_line":"                                          requested_networks, 2)"},{"line_number":1341,"context_line":"        self.assertEqual(max_count, 2)"},{"line_number":1342,"context_line":""},{"line_number":1343,"context_line":"    def test_validate_networks_no_quota_but_ports_supplied(self):"},{"line_number":1344,"context_line":"        # Test validation for a request for one instance needing"},{"line_number":1345,"context_line":"        # two ports, where the quota is 2 and 2 ports are in use"},{"line_number":1346,"context_line":"        # but the request includes a port to be used"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAWH%2F%2B51o%3D","line":1343,"in_reply_to":"AAAAWH%2F%2B54Q%3D","updated":"2014-03-21 20:13:23.000000000","message":"Done","commit_id":"c472bf131844f590dffc4c69f53bc34c5287bed0"}]}
