)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8b489d3b5844c3320f7a3cb37d7c25d8e0bfac17","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Vasyl Saienko \u003cvsaienko@mirantis.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-12-21 14:39:27 +0200"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Allow to attach/deatach VIF to portgroup"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"With this patch portgroups are activated in Ironic. Portgroups are picked"},{"line_number":10,"context_line":"first when attaching/detaching VIF to a node. It means that when node"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"da4df55a_dd4bfc29","line":7,"updated":"2016-12-22 23:04:57.000000000","message":"nit s/deatach/detach/","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"9abffc00afc80806775470eb7fe7456034f4b3ab","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Vasyl Saienko \u003cvsaienko@mirantis.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-12-21 14:39:27 +0200"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Allow to attach/deatach VIF to portgroup"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"With this patch portgroups are activated in Ironic. Portgroups are picked"},{"line_number":10,"context_line":"first when attaching/detaching VIF to a node. It means that when node"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"da4df55a_4a3377ab","line":7,"in_reply_to":"da4df55a_dd4bfc29","updated":"2016-12-26 12:48:11.000000000","message":"Done","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8b489d3b5844c3320f7a3cb37d7c25d8e0bfac17","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Allow to attach/deatach VIF to portgroup"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"With this patch portgroups are activated in Ironic. Portgroups are picked"},{"line_number":10,"context_line":"first when attaching/detaching VIF to a node. It means that when node"},{"line_number":11,"context_line":"has portgroups we trying to use the first, and only where there is no free"},{"line_number":12,"context_line":"portgroups left use single interfaces."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"da4df55a_18baf223","line":10,"updated":"2016-12-22 23:04:57.000000000","message":"not detaching :)","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"9abffc00afc80806775470eb7fe7456034f4b3ab","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Allow to attach/deatach VIF to portgroup"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"With this patch portgroups are activated in Ironic. Portgroups are picked"},{"line_number":10,"context_line":"first when attaching/detaching VIF to a node. It means that when node"},{"line_number":11,"context_line":"has portgroups we trying to use the first, and only where there is no free"},{"line_number":12,"context_line":"portgroups left use single interfaces."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"da4df55a_4ada974d","line":10,"in_reply_to":"da4df55a_18baf223","updated":"2016-12-26 12:48:11.000000000","message":"actually when detaching VIF we also search in portgroup.internal_info","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8b489d3b5844c3320f7a3cb37d7c25d8e0bfac17","unresolved":false,"context_lines":[{"line_number":9,"context_line":"With this patch portgroups are activated in Ironic. Portgroups are picked"},{"line_number":10,"context_line":"first when attaching/detaching VIF to a node. It means that when node"},{"line_number":11,"context_line":"has portgroups we trying to use the first, and only where there is no free"},{"line_number":12,"context_line":"portgroups left use single interfaces."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Related-Bug: #1618754"},{"line_number":15,"context_line":"Related-Bug: #1582188"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"da4df55a_78877e61","line":12,"updated":"2016-12-22 23:04:57.000000000","message":"what is \u0027single interfaces\u0027? Do you mean \u0027ports\u0027?","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"9abffc00afc80806775470eb7fe7456034f4b3ab","unresolved":false,"context_lines":[{"line_number":9,"context_line":"With this patch portgroups are activated in Ironic. Portgroups are picked"},{"line_number":10,"context_line":"first when attaching/detaching VIF to a node. It means that when node"},{"line_number":11,"context_line":"has portgroups we trying to use the first, and only where there is no free"},{"line_number":12,"context_line":"portgroups left use single interfaces."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Related-Bug: #1618754"},{"line_number":15,"context_line":"Related-Bug: #1582188"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"da4df55a_4ac1b753","line":12,"in_reply_to":"da4df55a_78877e61","updated":"2016-12-26 12:48:11.000000000","message":"rephrase it.","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"}],"ironic/api/controllers/v1/portgroup.py":[{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"cc22fcaa0d9c772a73b21feb859633fe7fd860b6","unresolved":false,"context_lines":[{"line_number":447,"context_line":"            raise wsme.exc.ClientSideError("},{"line_number":448,"context_line":"                error_msg, status_code\u003dhttp_client.BAD_REQUEST)"},{"line_number":449,"context_line":""},{"line_number":450,"context_line":"        vif \u003d portgroup.extra.get(\u0027vif_port_id\u0027)"},{"line_number":451,"context_line":"        if vif:"},{"line_number":452,"context_line":"            common_utils.warn_about_deprecated_extra_vif_port_id()"},{"line_number":453,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"7a3c09a3_3d75e6f8","line":450,"updated":"2017-01-13 22:39:29.000000000","message":"This one is incorrect as it seems, api returns the following if extra not passed in post request:\n\n \"POST /v1/portgroups HTTP/1.1\" status: 500  len: 478 time: 0.0352309\n 2017-01-14 00:33:57.068 ERROR wsme.api [req-a0725dbc-cc4a-4486-bf4d-759ff1bfdf9c 6fbcf3db66834d67be38f76cf95538e7 55f95b52a45c44da92e098fc9e6aa696] Server-side error: \"\u0027UnsetType\u0027 object has no attribute \u0027get\u0027\". Detail:\n Traceback (most recent call last):\n\n  File \"/usr/local/lib/python2.7/dist-packages/wsmeext/pecan.py\", line 85, in callfunction\n    result \u003d f(self, *args, **kwargs)\n\n  File \"/opt/stack/ironic/ironic/api/controllers/v1/portgroup.py\", line 450, in post\n    vif \u003d portgroup.extra.get(\u0027vif_port_id\u0027)\n\n AttributeError: \u0027UnsetType\u0027 object has no attribute \u0027get\u0027","commit_id":"9572a8f19c9a709fa7b673ffa4c860ee99074c05"}],"ironic/common/utils.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"c2670dd47e282f024cda1793515d6d60000e10f2","unresolved":false,"context_lines":[{"line_number":547,"context_line":"        LOG.warning(_LW(\"Attaching VIF to a port/portgroup via \""},{"line_number":548,"context_line":"                        \"extra[\u0027vif_port_id\u0027] is deprecated and will not \""},{"line_number":549,"context_line":"                        \"be supported in Pike release. API endpoint \""},{"line_number":550,"context_line":"                        \"v1/nodes/\u003cnode\u003e/vifs should be used instead.\"))"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5201f7_c957a7c8","line":550,"updated":"2017-01-10 19:38:09.000000000","message":"If I was trying to debug this, i\u0027d want to know which port or portgroup, in case it was one particular one, but I guess this is sufficient, especially since we\u0027re only issuing this once.","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"c58edcb89d8358dc06cf1388ca4465a7594c30b3","unresolved":false,"context_lines":[{"line_number":547,"context_line":"        LOG.warning(_LW(\"Attaching VIF to a port/portgroup via \""},{"line_number":548,"context_line":"                        \"extra[\u0027vif_port_id\u0027] is deprecated and will not \""},{"line_number":549,"context_line":"                        \"be supported in Pike release. API endpoint \""},{"line_number":550,"context_line":"                        \"v1/nodes/\u003cnode\u003e/vifs should be used instead.\"))"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5201f7_9009252f","line":550,"in_reply_to":"ba5201f7_c957a7c8","updated":"2017-01-11 10:13:29.000000000","message":"Yeah, this would bring more logic without actual benefit, we just want to say that both things are deprecated.","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"}],"ironic/drivers/modules/network/common.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8b489d3b5844c3320f7a3cb37d7c25d8e0bfac17","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        # Do not touch neutron port if we removed address on portgroup."},{"line_number":112,"context_line":"        if (\u0027address\u0027 in portgroup_obj.obj_what_changed() and"},{"line_number":113,"context_line":"                portgroup_obj.address):"},{"line_number":114,"context_line":"            pg_vif \u003d portgroup_obj.extra.get(\u0027vif_port_id\u0027)"},{"line_number":115,"context_line":"            if pg_vif:"},{"line_number":116,"context_line":"                neutron.update_port_address(pg_vif,"},{"line_number":117,"context_line":"                                            portgroup_obj.address,"}],"source_content_type":"text/x-python","patch_set":7,"id":"da4df55a_3dd96822","line":114,"updated":"2016-12-22 23:04:57.000000000","message":"or portgroup_obj.internal_info.get(TENANT_VIF_KEY)\n\nI think you had this in a dependent patch but we removed it from there cuz portgroups didn\u0027t have .internal_info[]\n\nwe should make sure this isn\u0027t the only place where we have to update to check for both.","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"9abffc00afc80806775470eb7fe7456034f4b3ab","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        # Do not touch neutron port if we removed address on portgroup."},{"line_number":112,"context_line":"        if (\u0027address\u0027 in portgroup_obj.obj_what_changed() and"},{"line_number":113,"context_line":"                portgroup_obj.address):"},{"line_number":114,"context_line":"            pg_vif \u003d portgroup_obj.extra.get(\u0027vif_port_id\u0027)"},{"line_number":115,"context_line":"            if pg_vif:"},{"line_number":116,"context_line":"                neutron.update_port_address(pg_vif,"},{"line_number":117,"context_line":"                                            portgroup_obj.address,"}],"source_content_type":"text/x-python","patch_set":7,"id":"da4df55a_ca94c744","line":114,"in_reply_to":"da4df55a_3dd96822","updated":"2016-12-26 12:48:11.000000000","message":"Done","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8b489d3b5844c3320f7a3cb37d7c25d8e0bfac17","unresolved":false,"context_lines":[{"line_number":147,"context_line":"            entry with the ID of the VIF."},{"line_number":148,"context_line":"        \"\"\""},{"line_number":149,"context_line":"        vifs \u003d []"},{"line_number":150,"context_line":"        for port in task.ports:"},{"line_number":151,"context_line":"            vif_id \u003d port.internal_info.get("},{"line_number":152,"context_line":"                TENANT_VIF_KEY, port.extra.get(\u0027vif_port_id\u0027))"},{"line_number":153,"context_line":"            if vif_id:"}],"source_content_type":"text/x-python","patch_set":7,"id":"da4df55a_389df665","line":150,"updated":"2016-12-22 23:04:57.000000000","message":"vifs can also be in portgroups now. or maybe they could always be in portgroups, i\u0027m not sure, did portgroup.extra[\u0027vif_port_id\u0027] ever exist? if not, we don\u0027t have to deprecate it :)","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"9abffc00afc80806775470eb7fe7456034f4b3ab","unresolved":false,"context_lines":[{"line_number":147,"context_line":"            entry with the ID of the VIF."},{"line_number":148,"context_line":"        \"\"\""},{"line_number":149,"context_line":"        vifs \u003d []"},{"line_number":150,"context_line":"        for port in task.ports:"},{"line_number":151,"context_line":"            vif_id \u003d port.internal_info.get("},{"line_number":152,"context_line":"                TENANT_VIF_KEY, port.extra.get(\u0027vif_port_id\u0027))"},{"line_number":153,"context_line":"            if vif_id:"}],"source_content_type":"text/x-python","patch_set":7,"id":"da4df55a_0aa96f7b","line":150,"in_reply_to":"da4df55a_389df665","updated":"2016-12-26 12:48:11.000000000","message":"We picked VIF from portgroup.extra previously, but it worked only in standalone mode (without Nova). We had never have support of portgroups in Nova.\n\nhttps://github.com/openstack/ironic/blob/master/ironic/common/network.py#L41","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8b489d3b5844c3320f7a3cb37d7c25d8e0bfac17","unresolved":false,"context_lines":[{"line_number":158,"context_line":"        \"\"\"Attach a virtual network interface to a node"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        Attach a virtual interface to a node free portgroup if exists,"},{"line_number":161,"context_line":"        use port only when no free portgroups are left."},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"        :param task: A TaskManager instance."},{"line_number":164,"context_line":"        :param vif_info: a dictionary of information about a VIF."}],"source_content_type":"text/x-python","patch_set":7,"id":"da4df55a_dd3f7c23","line":161,"updated":"2016-12-22 23:04:57.000000000","message":"How about\n\nAttach a virtual interface to a node. It will use the first free port group. If there are no free port groups, then the first available port (pxe_enabled preferably) is used.","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"9abffc00afc80806775470eb7fe7456034f4b3ab","unresolved":false,"context_lines":[{"line_number":158,"context_line":"        \"\"\"Attach a virtual network interface to a node"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        Attach a virtual interface to a node free portgroup if exists,"},{"line_number":161,"context_line":"        use port only when no free portgroups are left."},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"        :param task: A TaskManager instance."},{"line_number":164,"context_line":"        :param vif_info: a dictionary of information about a VIF."}],"source_content_type":"text/x-python","patch_set":7,"id":"da4df55a_0aeecfb3","line":161,"in_reply_to":"da4df55a_dd3f7c23","updated":"2016-12-26 12:48:11.000000000","message":"Done","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8b489d3b5844c3320f7a3cb37d7c25d8e0bfac17","unresolved":false,"context_lines":[{"line_number":174,"context_line":"        # first"},{"line_number":175,"context_line":"        sorted_ports \u003d sorted(ports, key\u003dlambda p: p.pxe_enabled, reverse\u003dTrue)"},{"line_number":176,"context_line":"        portgroups \u003d task.portgroups"},{"line_number":177,"context_line":"        free_p_objcts \u003d []"},{"line_number":178,"context_line":"        # Check all ports to ensure this VIF isn\u0027t already attached"},{"line_number":179,"context_line":"        for p_obj in portgroups + sorted_ports:"},{"line_number":180,"context_line":"            p_obj_id \u003d p_obj.internal_info.get(TENANT_VIF_KEY,"}],"source_content_type":"text/x-python","patch_set":7,"id":"da4df55a_dd205c4c","line":177,"updated":"2016-12-22 23:04:57.000000000","message":"\u0027objcts\u0027 is short for \u0027objects\u0027 ? There\u0027s only one char diff; I\u0027d just spell out the word :)\n\nIf this is to include ports and portgroups, maybe we should start using  eg \u0027free_ports_and_groups\u0027 :) \u0027free_p_pgroups\u0027? But I guess we use \u0027p_obj\u0027 to refer to one of these things.","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"9abffc00afc80806775470eb7fe7456034f4b3ab","unresolved":false,"context_lines":[{"line_number":174,"context_line":"        # first"},{"line_number":175,"context_line":"        sorted_ports \u003d sorted(ports, key\u003dlambda p: p.pxe_enabled, reverse\u003dTrue)"},{"line_number":176,"context_line":"        portgroups \u003d task.portgroups"},{"line_number":177,"context_line":"        free_p_objcts \u003d []"},{"line_number":178,"context_line":"        # Check all ports to ensure this VIF isn\u0027t already attached"},{"line_number":179,"context_line":"        for p_obj in portgroups + sorted_ports:"},{"line_number":180,"context_line":"            p_obj_id \u003d p_obj.internal_info.get(TENANT_VIF_KEY,"}],"source_content_type":"text/x-python","patch_set":7,"id":"da4df55a_6a0afb7a","line":177,"in_reply_to":"da4df55a_dd205c4c","updated":"2016-12-26 12:48:11.000000000","message":"replaced by free_p_objects.","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8b489d3b5844c3320f7a3cb37d7c25d8e0bfac17","unresolved":false,"context_lines":[{"line_number":175,"context_line":"        sorted_ports \u003d sorted(ports, key\u003dlambda p: p.pxe_enabled, reverse\u003dTrue)"},{"line_number":176,"context_line":"        portgroups \u003d task.portgroups"},{"line_number":177,"context_line":"        free_p_objcts \u003d []"},{"line_number":178,"context_line":"        # Check all ports to ensure this VIF isn\u0027t already attached"},{"line_number":179,"context_line":"        for p_obj in portgroups + sorted_ports:"},{"line_number":180,"context_line":"            p_obj_id \u003d p_obj.internal_info.get(TENANT_VIF_KEY,"},{"line_number":181,"context_line":"                                               p_obj.extra.get(\u0027vif_port_id\u0027))"}],"source_content_type":"text/x-python","patch_set":7,"id":"da4df55a_9dab3489","line":178,"updated":"2016-12-22 23:04:57.000000000","message":"s/ports/ports and portgroups/","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"9abffc00afc80806775470eb7fe7456034f4b3ab","unresolved":false,"context_lines":[{"line_number":175,"context_line":"        sorted_ports \u003d sorted(ports, key\u003dlambda p: p.pxe_enabled, reverse\u003dTrue)"},{"line_number":176,"context_line":"        portgroups \u003d task.portgroups"},{"line_number":177,"context_line":"        free_p_objcts \u003d []"},{"line_number":178,"context_line":"        # Check all ports to ensure this VIF isn\u0027t already attached"},{"line_number":179,"context_line":"        for p_obj in portgroups + sorted_ports:"},{"line_number":180,"context_line":"            p_obj_id \u003d p_obj.internal_info.get(TENANT_VIF_KEY,"},{"line_number":181,"context_line":"                                               p_obj.extra.get(\u0027vif_port_id\u0027))"}],"source_content_type":"text/x-python","patch_set":7,"id":"da4df55a_8a38ff3e","line":178,"in_reply_to":"da4df55a_9dab3489","updated":"2016-12-26 12:48:11.000000000","message":"Done","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8b489d3b5844c3320f7a3cb37d7c25d8e0bfac17","unresolved":false,"context_lines":[{"line_number":231,"context_line":""},{"line_number":232,"context_line":"        ports \u003d [p for p in task.ports if p.portgroup_id is None]"},{"line_number":233,"context_line":"        portgroups \u003d task.portgroups"},{"line_number":234,"context_line":"        for p_obj in portgroups + ports:"},{"line_number":235,"context_line":"            # FIXME(sambetts) Remove this when we no longer support a nova"},{"line_number":236,"context_line":"            # driver that uses port.extra"},{"line_number":237,"context_line":"            if (p_obj.extra.get(\"vif_port_id\") \u003d\u003d vif_id or"}],"source_content_type":"text/x-python","patch_set":7,"id":"da4df55a_38d97622","line":234,"updated":"2016-12-22 23:04:57.000000000","message":"btw, I\u0027ve seen this be called \u0027port_like_obj\u0027 which seems better than p_obj.","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8b489d3b5844c3320f7a3cb37d7c25d8e0bfac17","unresolved":false,"context_lines":[{"line_number":262,"context_line":""},{"line_number":263,"context_line":"        return (p_obj.internal_info.get(\u0027cleaning_vif_port_id\u0027) or"},{"line_number":264,"context_line":"                p_obj.internal_info.get(\u0027provisioning_vif_port_id\u0027) or"},{"line_number":265,"context_line":"                p_obj.internal_info.get(\u0027tenant_vif_port_id\u0027) or"},{"line_number":266,"context_line":"                p_obj.extra.get(\u0027vif_port_id\u0027) or None)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da4df55a_98998271","line":265,"updated":"2016-12-22 23:04:57.000000000","message":"i just realized that this can be TENANT_VIF_KEY (but am too lazy to point it out in the actual patch that has this)","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"07c9d5291caf06e0c179bcbc4b8d21ea3acc6d0f","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        if \u0027extra\u0027 in portgroup_obj.obj_what_changed():"},{"line_number":125,"context_line":"            original_portgroup \u003d objects.Portgroup.get_by_id(context,"},{"line_number":126,"context_line":"                                                             portgroup_obj.id)"},{"line_number":127,"context_line":"            if (portgroup_obj.extra.get(\u0027vif_port_id\u0027) !\u003d"},{"line_number":128,"context_line":"                    original_portgroup.extra.get(\u0027vif_port_id\u0027)):"},{"line_number":129,"context_line":"                utils.warn_about_deprecated_extra_vif_port_id()"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5201f7_3df4f1cd","line":127,"updated":"2017-01-10 17:39:07.000000000","message":"Same thing as in base patch here - if we\u0027re removing it, better not to print it.","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"c2670dd47e282f024cda1793515d6d60000e10f2","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        if \u0027extra\u0027 in portgroup_obj.obj_what_changed():"},{"line_number":125,"context_line":"            original_portgroup \u003d objects.Portgroup.get_by_id(context,"},{"line_number":126,"context_line":"                                                             portgroup_obj.id)"},{"line_number":127,"context_line":"            if (portgroup_obj.extra.get(\u0027vif_port_id\u0027) !\u003d"},{"line_number":128,"context_line":"                    original_portgroup.extra.get(\u0027vif_port_id\u0027)):"},{"line_number":129,"context_line":"                utils.warn_about_deprecated_extra_vif_port_id()"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5201f7_89367fb2","line":127,"updated":"2017-01-10 19:38:09.000000000","message":"this needs to be updated to be\n\nif (portgroup_obj.extra.get(\u0027vif_port_id\u0027) and new !\u003d old:","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"c58edcb89d8358dc06cf1388ca4465a7594c30b3","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        if \u0027extra\u0027 in portgroup_obj.obj_what_changed():"},{"line_number":125,"context_line":"            original_portgroup \u003d objects.Portgroup.get_by_id(context,"},{"line_number":126,"context_line":"                                                             portgroup_obj.id)"},{"line_number":127,"context_line":"            if (portgroup_obj.extra.get(\u0027vif_port_id\u0027) !\u003d"},{"line_number":128,"context_line":"                    original_portgroup.extra.get(\u0027vif_port_id\u0027)):"},{"line_number":129,"context_line":"                utils.warn_about_deprecated_extra_vif_port_id()"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5201f7_b0854908","line":127,"in_reply_to":"ba5201f7_89367fb2","updated":"2017-01-11 10:13:29.000000000","message":"Done","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"c2670dd47e282f024cda1793515d6d60000e10f2","unresolved":false,"context_lines":[{"line_number":180,"context_line":"        \"\"\""},{"line_number":181,"context_line":"        vif_id \u003d vif_info[\u0027id\u0027]"},{"line_number":182,"context_line":"        # NOTE(vsaienko) pick ports without portgroup_id. If portgroup_id is"},{"line_number":183,"context_line":"        # set attach vif to portgroup instead."},{"line_number":184,"context_line":"        ports \u003d [p for p in task.ports if p.portgroup_id is None]"},{"line_number":185,"context_line":"        # Sort ports by pxe_enabled to ensure we always bind pxe_enabled ports"},{"line_number":186,"context_line":"        # first"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5201f7_29ccb360","line":183,"updated":"2017-01-10 19:38:09.000000000","message":"this NOTE is a bit odd since it seems to indicate we\u0027ll use a port, and if we can\u0027t get a free port, we\u0027ll use a port group. but it is the other way around.","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"c58edcb89d8358dc06cf1388ca4465a7594c30b3","unresolved":false,"context_lines":[{"line_number":180,"context_line":"        \"\"\""},{"line_number":181,"context_line":"        vif_id \u003d vif_info[\u0027id\u0027]"},{"line_number":182,"context_line":"        # NOTE(vsaienko) pick ports without portgroup_id. If portgroup_id is"},{"line_number":183,"context_line":"        # set attach vif to portgroup instead."},{"line_number":184,"context_line":"        ports \u003d [p for p in task.ports if p.portgroup_id is None]"},{"line_number":185,"context_line":"        # Sort ports by pxe_enabled to ensure we always bind pxe_enabled ports"},{"line_number":186,"context_line":"        # first"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5201f7_d0680dbd","line":183,"in_reply_to":"ba5201f7_29ccb360","updated":"2017-01-11 10:13:29.000000000","message":"I\u0027ll reword, it should not mean that we are attaching it to ports instead of portgroups, but that we ignore ports that belong to portgroup.","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"c2670dd47e282f024cda1793515d6d60000e10f2","unresolved":false,"context_lines":[{"line_number":196,"context_line":"                free_port_like_objects.append(port_like_obj)"},{"line_number":197,"context_line":"            elif p_obj_id \u003d\u003d vif_id:"},{"line_number":198,"context_line":"                raise exception.VifAlreadyAttached("},{"line_number":199,"context_line":"                    vif\u003dvif_id, port_uuid\u003dport_like_obj.uuid)"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"        if not free_port_like_objects:"},{"line_number":202,"context_line":"            raise exception.NoFreePhysicalPorts(vif\u003dvif_id)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5201f7_89811f50","line":199,"updated":"2017-01-10 19:38:09.000000000","message":"We should probably update the exception message to include port groups: https://github.com/openstack/ironic/blob/18acfae5715e7b760053faf187f9478c23c2cbac/ironic/common/exception.py#L229-L236","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"c58edcb89d8358dc06cf1388ca4465a7594c30b3","unresolved":false,"context_lines":[{"line_number":196,"context_line":"                free_port_like_objects.append(port_like_obj)"},{"line_number":197,"context_line":"            elif p_obj_id \u003d\u003d vif_id:"},{"line_number":198,"context_line":"                raise exception.VifAlreadyAttached("},{"line_number":199,"context_line":"                    vif\u003dvif_id, port_uuid\u003dport_like_obj.uuid)"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"        if not free_port_like_objects:"},{"line_number":202,"context_line":"            raise exception.NoFreePhysicalPorts(vif\u003dvif_id)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5201f7_10ba9523","line":199,"in_reply_to":"ba5201f7_89811f50","updated":"2017-01-11 10:13:29.000000000","message":"Hmm, good catch!","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"c2670dd47e282f024cda1793515d6d60000e10f2","unresolved":false,"context_lines":[{"line_number":199,"context_line":"                    vif\u003dvif_id, port_uuid\u003dport_like_obj.uuid)"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"        if not free_port_like_objects:"},{"line_number":202,"context_line":"            raise exception.NoFreePhysicalPorts(vif\u003dvif_id)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        # Get first free p_object"},{"line_number":205,"context_line":"        port_like_obj \u003d free_port_like_objects.pop(0)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5201f7_69715b44","line":202,"updated":"2017-01-10 19:38:09.000000000","message":"ditto about exception msg","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"c58edcb89d8358dc06cf1388ca4465a7594c30b3","unresolved":false,"context_lines":[{"line_number":199,"context_line":"                    vif\u003dvif_id, port_uuid\u003dport_like_obj.uuid)"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"        if not free_port_like_objects:"},{"line_number":202,"context_line":"            raise exception.NoFreePhysicalPorts(vif\u003dvif_id)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        # Get first free p_object"},{"line_number":205,"context_line":"        port_like_obj \u003d free_port_like_objects.pop(0)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5201f7_109455e0","line":202,"in_reply_to":"ba5201f7_69715b44","updated":"2017-01-11 10:13:29.000000000","message":"This one seems to be correct, in a sense that there are no physical ports available to attach an interface. You need to add actual physical port (optionally add it to a new port group)","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"c2670dd47e282f024cda1793515d6d60000e10f2","unresolved":false,"context_lines":[{"line_number":201,"context_line":"        if not free_port_like_objects:"},{"line_number":202,"context_line":"            raise exception.NoFreePhysicalPorts(vif\u003dvif_id)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        # Get first free p_object"},{"line_number":205,"context_line":"        port_like_obj \u003d free_port_like_objects.pop(0)"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"        # Address is optional for portgroups"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5201f7_c998876d","line":204,"updated":"2017-01-10 19:38:09.000000000","message":"s/p_object/port-like object/","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"c58edcb89d8358dc06cf1388ca4465a7594c30b3","unresolved":false,"context_lines":[{"line_number":201,"context_line":"        if not free_port_like_objects:"},{"line_number":202,"context_line":"            raise exception.NoFreePhysicalPorts(vif\u003dvif_id)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        # Get first free p_object"},{"line_number":205,"context_line":"        port_like_obj \u003d free_port_like_objects.pop(0)"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"        # Address is optional for portgroups"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5201f7_308f99cd","line":204,"in_reply_to":"ba5201f7_c998876d","updated":"2017-01-11 10:13:29.000000000","message":"Done","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"95dcae662d4f2b2f0c0fecbf8f0b6c2e5ab43aff","unresolved":false,"context_lines":[{"line_number":200,"context_line":"            p_obj_id \u003d port_like_obj.internal_info.get("},{"line_number":201,"context_line":"                TENANT_VIF_KEY, port_like_obj.extra.get(\u0027vif_port_id\u0027))"},{"line_number":202,"context_line":"            if p_obj_id is None:"},{"line_number":203,"context_line":"                free_port_like_objects.append(port_like_obj)"},{"line_number":204,"context_line":"            elif p_obj_id \u003d\u003d vif_id:"},{"line_number":205,"context_line":"                raise exception.VifAlreadyAttached("},{"line_number":206,"context_line":"                    object_type\u003dport_like_obj.__class__.__name__,"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba5201f7_31bdd1d7","line":203,"updated":"2017-01-11 13:36:28.000000000","message":"Since we only use the first thing in free_port_like_obj, we can just break out of the loop here, right?","commit_id":"b46d82f39211ba907bf7480400761c873dab0acf"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"4ae0267ffda2d156a498dee6ebb6443171664ab4","unresolved":false,"context_lines":[{"line_number":200,"context_line":"            p_obj_id \u003d port_like_obj.internal_info.get("},{"line_number":201,"context_line":"                TENANT_VIF_KEY, port_like_obj.extra.get(\u0027vif_port_id\u0027))"},{"line_number":202,"context_line":"            if p_obj_id is None:"},{"line_number":203,"context_line":"                free_port_like_objects.append(port_like_obj)"},{"line_number":204,"context_line":"            elif p_obj_id \u003d\u003d vif_id:"},{"line_number":205,"context_line":"                raise exception.VifAlreadyAttached("},{"line_number":206,"context_line":"                    object_type\u003dport_like_obj.__class__.__name__,"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba5201f7_02ff9d01","line":203,"in_reply_to":"ba5201f7_31bdd1d7","updated":"2017-01-11 15:18:36.000000000","message":"Done","commit_id":"b46d82f39211ba907bf7480400761c873dab0acf"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"95dcae662d4f2b2f0c0fecbf8f0b6c2e5ab43aff","unresolved":false,"context_lines":[{"line_number":207,"context_line":"                    vif\u003dvif_id, object_uuid\u003dport_like_obj.uuid)"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        if not free_port_like_objects:"},{"line_number":210,"context_line":"            raise exception.NoFreePhysicalPorts(vif\u003dvif_id)"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"        # Get first free port-like object"},{"line_number":213,"context_line":"        port_like_obj \u003d free_port_like_objects.pop(0)"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba5201f7_d149e5d1","line":210,"updated":"2017-01-11 13:36:28.000000000","message":"I\u0027d love to break this entire block into another function, if it\u0027s possible, this one is getting pretty long.","commit_id":"b46d82f39211ba907bf7480400761c873dab0acf"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"4ae0267ffda2d156a498dee6ebb6443171664ab4","unresolved":false,"context_lines":[{"line_number":207,"context_line":"                    vif\u003dvif_id, object_uuid\u003dport_like_obj.uuid)"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        if not free_port_like_objects:"},{"line_number":210,"context_line":"            raise exception.NoFreePhysicalPorts(vif\u003dvif_id)"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"        # Get first free port-like object"},{"line_number":213,"context_line":"        port_like_obj \u003d free_port_like_objects.pop(0)"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba5201f7_620ce93b","line":210,"in_reply_to":"ba5201f7_d149e5d1","updated":"2017-01-11 15:18:36.000000000","message":"Done","commit_id":"b46d82f39211ba907bf7480400761c873dab0acf"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"94cef02d0d2a366bdb052ca4426ff1fad8ada754","unresolved":false,"context_lines":[{"line_number":32,"context_line":"TENANT_VIF_KEY \u003d \u0027tenant_vif_port_id\u0027"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"def get_free_node_interfaces(task, vif_id):"},{"line_number":36,"context_line":"    \"\"\"Returns list of free node\u0027s port-like objects."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    Ensure that VIF is not already attached to this node."}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_a1231a57","line":35,"updated":"2017-01-11 20:59:26.000000000","message":"nit, \u0027interfaces\u0027 is overloaded, especially with the new hardware interfaces. How about something like \u0027get_free_port_like_objects()\u0027","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"4859daf66345804f841e5c57939925ca6c376a52","unresolved":false,"context_lines":[{"line_number":32,"context_line":"TENANT_VIF_KEY \u003d \u0027tenant_vif_port_id\u0027"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"def get_free_node_interfaces(task, vif_id):"},{"line_number":36,"context_line":"    \"\"\"Returns list of free node\u0027s port-like objects."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    Ensure that VIF is not already attached to this node."}],"source_content_type":"text/x-python","patch_set":13,"id":"9a57fde8_c7499990","line":35,"in_reply_to":"ba5201f7_a1231a57","updated":"2017-01-12 13:39:54.000000000","message":"Done","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"94cef02d0d2a366bdb052ca4426ff1fad8ada754","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    :raises: VifAlreadyAttached if VIF is already attached."},{"line_number":43,"context_line":"    :returns: ordered port-like objects list VIF can be attached to."},{"line_number":44,"context_line":"    \"\"\""},{"line_number":45,"context_line":"    # This list contains ports selected as candidates for attachment"},{"line_number":46,"context_line":"    ports \u003d []"},{"line_number":47,"context_line":"    # This list contains portgroups selected as candidates for attachment"},{"line_number":48,"context_line":"    portgroups \u003d []"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_41ec2ef3","line":45,"updated":"2017-01-11 20:59:26.000000000","message":"since this is now a separate method, we don\u0027t know if the ports will be used as candidates for attachment, so maybe just \u0027contains free ports (no VIF)\u0027","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"f6454cbdcb8cbcdf662bc1996bbfc8821e608d48","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    :returns: ordered port-like objects list VIF can be attached to."},{"line_number":44,"context_line":"    \"\"\""},{"line_number":45,"context_line":"    # This list contains ports selected as candidates for attachment"},{"line_number":46,"context_line":"    ports \u003d []"},{"line_number":47,"context_line":"    # This list contains portgroups selected as candidates for attachment"},{"line_number":48,"context_line":"    portgroups \u003d []"},{"line_number":49,"context_line":"    # This is a mapping of portgroup id to collection of its ports"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_4cbf05aa","line":46,"updated":"2017-01-11 21:07:48.000000000","message":"maybe s/ports/free_ports/ to make it clearer","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"4859daf66345804f841e5c57939925ca6c376a52","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    :returns: ordered port-like objects list VIF can be attached to."},{"line_number":44,"context_line":"    \"\"\""},{"line_number":45,"context_line":"    # This list contains ports selected as candidates for attachment"},{"line_number":46,"context_line":"    ports \u003d []"},{"line_number":47,"context_line":"    # This list contains portgroups selected as candidates for attachment"},{"line_number":48,"context_line":"    portgroups \u003d []"},{"line_number":49,"context_line":"    # This is a mapping of portgroup id to collection of its ports"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a57fde8_87815192","line":46,"in_reply_to":"ba5201f7_4cbf05aa","updated":"2017-01-12 13:39:54.000000000","message":"Done","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"94cef02d0d2a366bdb052ca4426ff1fad8ada754","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    \"\"\""},{"line_number":45,"context_line":"    # This list contains ports selected as candidates for attachment"},{"line_number":46,"context_line":"    ports \u003d []"},{"line_number":47,"context_line":"    # This list contains portgroups selected as candidates for attachment"},{"line_number":48,"context_line":"    portgroups \u003d []"},{"line_number":49,"context_line":"    # This is a mapping of portgroup id to collection of its ports"},{"line_number":50,"context_line":"    ports_by_portgroup \u003d collections.defaultdict(list)"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_61bbf2e5","line":47,"updated":"2017-01-11 20:59:26.000000000","message":"ditto","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"994b07e73db19fea4b2b8d1c804789f75947c867","unresolved":false,"context_lines":[{"line_number":44,"context_line":"    \"\"\""},{"line_number":45,"context_line":"    # This list contains ports selected as candidates for attachment"},{"line_number":46,"context_line":"    ports \u003d []"},{"line_number":47,"context_line":"    # This list contains portgroups selected as candidates for attachment"},{"line_number":48,"context_line":"    portgroups \u003d []"},{"line_number":49,"context_line":"    # This is a mapping of portgroup id to collection of its ports"},{"line_number":50,"context_line":"    ports_by_portgroup \u003d collections.defaultdict(list)"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_cc5cd57f","line":47,"in_reply_to":"ba5201f7_61bbf2e5","updated":"2017-01-11 21:15:47.000000000","message":"It\u0027d be pretty hard to describe the relation with ports and vifs here. I still consider these arrays as candidates, this function returns them all. The method using it just doing [0], but that\u0027s that method logic.","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"f6454cbdcb8cbcdf662bc1996bbfc8821e608d48","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    # This list contains ports selected as candidates for attachment"},{"line_number":46,"context_line":"    ports \u003d []"},{"line_number":47,"context_line":"    # This list contains portgroups selected as candidates for attachment"},{"line_number":48,"context_line":"    portgroups \u003d []"},{"line_number":49,"context_line":"    # This is a mapping of portgroup id to collection of its ports"},{"line_number":50,"context_line":"    ports_by_portgroup \u003d collections.defaultdict(list)"},{"line_number":51,"context_line":"    # This set contains IDs of portgroups that should be ignored, as they have"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_8cbc8dbc","line":48,"updated":"2017-01-11 21:07:48.000000000","message":"maybe s/portgroups/free_portgroups/ to make it clearer","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"4859daf66345804f841e5c57939925ca6c376a52","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    # This list contains ports selected as candidates for attachment"},{"line_number":46,"context_line":"    ports \u003d []"},{"line_number":47,"context_line":"    # This list contains portgroups selected as candidates for attachment"},{"line_number":48,"context_line":"    portgroups \u003d []"},{"line_number":49,"context_line":"    # This is a mapping of portgroup id to collection of its ports"},{"line_number":50,"context_line":"    ports_by_portgroup \u003d collections.defaultdict(list)"},{"line_number":51,"context_line":"    # This set contains IDs of portgroups that should be ignored, as they have"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a57fde8_07448172","line":48,"in_reply_to":"ba5201f7_8cbc8dbc","updated":"2017-01-12 13:39:54.000000000","message":"Done","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"94cef02d0d2a366bdb052ca4426ff1fad8ada754","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    ports_by_portgroup \u003d collections.defaultdict(list)"},{"line_number":51,"context_line":"    # This set contains IDs of portgroups that should be ignored, as they have"},{"line_number":52,"context_line":"    # at least one port with vif already attached to it"},{"line_number":53,"context_line":"    non_usable_portgroups \u003d set()"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def _vif_attached(port_like_obj):"},{"line_number":56,"context_line":"        # Check all ports and portgroups to ensure this VIF isn\u0027t already"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_0194e640","line":53,"updated":"2017-01-11 20:59:26.000000000","message":"to make sure I understand, does portgroups + non_usable_portgroups \u003d\u003d total portgroups?","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"f6454cbdcb8cbcdf662bc1996bbfc8821e608d48","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    ports_by_portgroup \u003d collections.defaultdict(list)"},{"line_number":51,"context_line":"    # This set contains IDs of portgroups that should be ignored, as they have"},{"line_number":52,"context_line":"    # at least one port with vif already attached to it"},{"line_number":53,"context_line":"    non_usable_portgroups \u003d set()"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def _vif_attached(port_like_obj):"},{"line_number":56,"context_line":"        # Check all ports and portgroups to ensure this VIF isn\u0027t already"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_0ca25d99","line":53,"in_reply_to":"ba5201f7_0194e640","updated":"2017-01-11 21:07:48.000000000","message":"Answering my own question, NO.","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"994b07e73db19fea4b2b8d1c804789f75947c867","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    ports_by_portgroup \u003d collections.defaultdict(list)"},{"line_number":51,"context_line":"    # This set contains IDs of portgroups that should be ignored, as they have"},{"line_number":52,"context_line":"    # at least one port with vif already attached to it"},{"line_number":53,"context_line":"    non_usable_portgroups \u003d set()"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def _vif_attached(port_like_obj):"},{"line_number":56,"context_line":"        # Check all ports and portgroups to ensure this VIF isn\u0027t already"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_8ccd6d33","line":53,"in_reply_to":"ba5201f7_0194e640","updated":"2017-01-11 21:15:47.000000000","message":"no, portgroups + non_usable_portgroups + portgroups with vif attached \u003d\u003d total portgroups. _vif_attached does filtering too, as it does continue without adding objects to ports/portgroups arrays.","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"0e65f3a2fb6da6c63586351b7cc451b84ad79a07","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    ports_by_portgroup \u003d collections.defaultdict(list)"},{"line_number":51,"context_line":"    # This set contains IDs of portgroups that should be ignored, as they have"},{"line_number":52,"context_line":"    # at least one port with vif already attached to it"},{"line_number":53,"context_line":"    non_usable_portgroups \u003d set()"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def _vif_attached(port_like_obj):"},{"line_number":56,"context_line":"        # Check all ports and portgroups to ensure this VIF isn\u0027t already"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_6775c296","line":53,"in_reply_to":"ba5201f7_8ccd6d33","updated":"2017-01-11 21:21:07.000000000","message":"and + empty portgroups, if i have not missed anything :D","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"94cef02d0d2a366bdb052ca4426ff1fad8ada754","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    non_usable_portgroups \u003d set()"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def _vif_attached(port_like_obj):"},{"line_number":56,"context_line":"        # Check all ports and portgroups to ensure this VIF isn\u0027t already"},{"line_number":57,"context_line":"        # attached"},{"line_number":58,"context_line":"        attached_vif_id \u003d port_like_obj.internal_info.get("},{"line_number":59,"context_line":"            TENANT_VIF_KEY, port_like_obj.extra.get(\u0027vif_port_id\u0027))"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_01f7868b","line":56,"updated":"2017-01-11 20:59:26.000000000","message":"s/all ports and portgroups/this port_like_obj (a port or port group)/","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"4859daf66345804f841e5c57939925ca6c376a52","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    non_usable_portgroups \u003d set()"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def _vif_attached(port_like_obj):"},{"line_number":56,"context_line":"        # Check all ports and portgroups to ensure this VIF isn\u0027t already"},{"line_number":57,"context_line":"        # attached"},{"line_number":58,"context_line":"        attached_vif_id \u003d port_like_obj.internal_info.get("},{"line_number":59,"context_line":"            TENANT_VIF_KEY, port_like_obj.extra.get(\u0027vif_port_id\u0027))"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a57fde8_675b8d55","line":56,"in_reply_to":"ba5201f7_01f7868b","updated":"2017-01-12 13:39:54.000000000","message":"Done","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"94cef02d0d2a366bdb052ca4426ff1fad8ada754","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def _vif_attached(port_like_obj):"},{"line_number":56,"context_line":"        # Check all ports and portgroups to ensure this VIF isn\u0027t already"},{"line_number":57,"context_line":"        # attached"},{"line_number":58,"context_line":"        attached_vif_id \u003d port_like_obj.internal_info.get("},{"line_number":59,"context_line":"            TENANT_VIF_KEY, port_like_obj.extra.get(\u0027vif_port_id\u0027))"},{"line_number":60,"context_line":"        if attached_vif_id \u003d\u003d vif_id:"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_211e4abb","line":57,"updated":"2017-01-11 20:59:26.000000000","message":"we should probably document this correctly. It\n1. returns TRUE if the port_like_obj has a VIF attached\n2. raises an exception if the attached VIF is the vif_id\n3. returns FALSE otherwise","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"4859daf66345804f841e5c57939925ca6c376a52","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def _vif_attached(port_like_obj):"},{"line_number":56,"context_line":"        # Check all ports and portgroups to ensure this VIF isn\u0027t already"},{"line_number":57,"context_line":"        # attached"},{"line_number":58,"context_line":"        attached_vif_id \u003d port_like_obj.internal_info.get("},{"line_number":59,"context_line":"            TENANT_VIF_KEY, port_like_obj.extra.get(\u0027vif_port_id\u0027))"},{"line_number":60,"context_line":"        if attached_vif_id \u003d\u003d vif_id:"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a57fde8_a755751e","line":57,"in_reply_to":"ba5201f7_211e4abb","updated":"2017-01-12 13:39:54.000000000","message":"Done","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"94cef02d0d2a366bdb052ca4426ff1fad8ada754","unresolved":false,"context_lines":[{"line_number":63,"context_line":"                vif\u003dvif_id, object_uuid\u003dport_like_obj.uuid)"},{"line_number":64,"context_line":"        if attached_vif_id:"},{"line_number":65,"context_line":"            return True"},{"line_number":66,"context_line":"        return False"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    for p in task.ports:"},{"line_number":69,"context_line":"        if _vif_attached(p):"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_e1552250","line":66,"updated":"2017-01-11 20:59:26.000000000","message":"the above 3 lines could be \u0027return attached_vif_id !\u003d None\u0027","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"4859daf66345804f841e5c57939925ca6c376a52","unresolved":false,"context_lines":[{"line_number":63,"context_line":"                vif\u003dvif_id, object_uuid\u003dport_like_obj.uuid)"},{"line_number":64,"context_line":"        if attached_vif_id:"},{"line_number":65,"context_line":"            return True"},{"line_number":66,"context_line":"        return False"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    for p in task.ports:"},{"line_number":69,"context_line":"        if _vif_attached(p):"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a57fde8_c730b90a","line":66,"in_reply_to":"ba5201f7_e1552250","updated":"2017-01-12 13:39:54.000000000","message":"Done","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"94cef02d0d2a366bdb052ca4426ff1fad8ada754","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        if pg.id in non_usable_portgroups:"},{"line_number":84,"context_line":"            # This portgroup has vifs attached to its ports, consider its"},{"line_number":85,"context_line":"            # ports instead to avoid collisions"},{"line_number":86,"context_line":"            ports.extend(ports_by_portgroup[pg.id])"},{"line_number":87,"context_line":"        elif ports_by_portgroup[pg.id]:"},{"line_number":88,"context_line":"            # Also ignore empty portgroups"},{"line_number":89,"context_line":"            portgroups.append(pg)"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_ac06b119","line":86,"updated":"2017-01-11 20:59:26.000000000","message":"this won\u0027t work if pg.id is not in ports_by_portgroup.","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"994b07e73db19fea4b2b8d1c804789f75947c867","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        if pg.id in non_usable_portgroups:"},{"line_number":84,"context_line":"            # This portgroup has vifs attached to its ports, consider its"},{"line_number":85,"context_line":"            # ports instead to avoid collisions"},{"line_number":86,"context_line":"            ports.extend(ports_by_portgroup[pg.id])"},{"line_number":87,"context_line":"        elif ports_by_portgroup[pg.id]:"},{"line_number":88,"context_line":"            # Also ignore empty portgroups"},{"line_number":89,"context_line":"            portgroups.append(pg)"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_ccd3f5d3","line":86,"in_reply_to":"ba5201f7_ac06b119","updated":"2017-01-11 21:15:47.000000000","message":"It is a defaultdict so it will work","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"ec9e97bf1e8b65dd088b585d1e0a54cdc1dcb0d3","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        if pg.id in non_usable_portgroups:"},{"line_number":84,"context_line":"            # This portgroup has vifs attached to its ports, consider its"},{"line_number":85,"context_line":"            # ports instead to avoid collisions"},{"line_number":86,"context_line":"            ports.extend(ports_by_portgroup[pg.id])"},{"line_number":87,"context_line":"        elif ports_by_portgroup[pg.id]:"},{"line_number":88,"context_line":"            # Also ignore empty portgroups"},{"line_number":89,"context_line":"            portgroups.append(pg)"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_a7da4a49","line":86,"in_reply_to":"ba5201f7_ccd3f5d3","updated":"2017-01-11 21:31:57.000000000","message":"Oops, my bad. I missed the collections.defaultdict() part; was thinking it was just a normal dict.","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"94cef02d0d2a366bdb052ca4426ff1fad8ada754","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            # This portgroup has vifs attached to its ports, consider its"},{"line_number":85,"context_line":"            # ports instead to avoid collisions"},{"line_number":86,"context_line":"            ports.extend(ports_by_portgroup[pg.id])"},{"line_number":87,"context_line":"        elif ports_by_portgroup[pg.id]:"},{"line_number":88,"context_line":"            # Also ignore empty portgroups"},{"line_number":89,"context_line":"            portgroups.append(pg)"},{"line_number":90,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_aca231fa","line":87,"updated":"2017-01-11 20:59:26.000000000","message":"You can create a portgroup that doesn\u0027t have any ports, right? So this should be a check for pg.id in ports_by_portgroup.","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"782f8b81c355de31af5f63c48d530d251d575630","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            # This portgroup has vifs attached to its ports, consider its"},{"line_number":85,"context_line":"            # ports instead to avoid collisions"},{"line_number":86,"context_line":"            ports.extend(ports_by_portgroup[pg.id])"},{"line_number":87,"context_line":"        elif ports_by_portgroup[pg.id]:"},{"line_number":88,"context_line":"            # Also ignore empty portgroups"},{"line_number":89,"context_line":"            portgroups.append(pg)"},{"line_number":90,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_ec0d193f","line":87,"in_reply_to":"ba5201f7_8cf48d5b","updated":"2017-01-11 21:17:55.000000000","message":"oh, right, I see, will check it, maybe indeed i\u0027ve missed this.","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"994b07e73db19fea4b2b8d1c804789f75947c867","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            # This portgroup has vifs attached to its ports, consider its"},{"line_number":85,"context_line":"            # ports instead to avoid collisions"},{"line_number":86,"context_line":"            ports.extend(ports_by_portgroup[pg.id])"},{"line_number":87,"context_line":"        elif ports_by_portgroup[pg.id]:"},{"line_number":88,"context_line":"            # Also ignore empty portgroups"},{"line_number":89,"context_line":"            portgroups.append(pg)"},{"line_number":90,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_8cf48d5b","line":87,"in_reply_to":"ba5201f7_aca231fa","updated":"2017-01-11 21:15:47.000000000","message":"ditto, defaultdict","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"3b40a36bf5865870949287eda72fb3f56104eee4","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            # This portgroup has vifs attached to its ports, consider its"},{"line_number":85,"context_line":"            # ports instead to avoid collisions"},{"line_number":86,"context_line":"            ports.extend(ports_by_portgroup[pg.id])"},{"line_number":87,"context_line":"        elif ports_by_portgroup[pg.id]:"},{"line_number":88,"context_line":"            # Also ignore empty portgroups"},{"line_number":89,"context_line":"            portgroups.append(pg)"},{"line_number":90,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_672782b6","line":87,"in_reply_to":"ba5201f7_ec0d193f","updated":"2017-01-11 21:19:23.000000000","message":"otoh, this is [] if the portgroup is empty, so execution won\u0027t go inside.","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"94cef02d0d2a366bdb052ca4426ff1fad8ada754","unresolved":false,"context_lines":[{"line_number":85,"context_line":"            # ports instead to avoid collisions"},{"line_number":86,"context_line":"            ports.extend(ports_by_portgroup[pg.id])"},{"line_number":87,"context_line":"        elif ports_by_portgroup[pg.id]:"},{"line_number":88,"context_line":"            # Also ignore empty portgroups"},{"line_number":89,"context_line":"            portgroups.append(pg)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    # Sort ports by pxe_enabled to ensure we always bind pxe_enabled ports"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_6cea0911","line":88,"updated":"2017-01-11 20:59:26.000000000","message":"this comment refers to L87, right? Not L89?","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"994b07e73db19fea4b2b8d1c804789f75947c867","unresolved":false,"context_lines":[{"line_number":85,"context_line":"            # ports instead to avoid collisions"},{"line_number":86,"context_line":"            ports.extend(ports_by_portgroup[pg.id])"},{"line_number":87,"context_line":"        elif ports_by_portgroup[pg.id]:"},{"line_number":88,"context_line":"            # Also ignore empty portgroups"},{"line_number":89,"context_line":"            portgroups.append(pg)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    # Sort ports by pxe_enabled to ensure we always bind pxe_enabled ports"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_ec035940","line":88,"in_reply_to":"ba5201f7_6cea0911","updated":"2017-01-11 21:15:47.000000000","message":"yup","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"50d6c76c5e5d4fdeb592b9e48724f7cef6f03c61","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    # first"},{"line_number":93,"context_line":"    sorted_ports \u003d sorted(ports, key\u003dlambda p: p.pxe_enabled, reverse\u003dTrue)"},{"line_number":94,"context_line":"    # portgroups are higher priority"},{"line_number":95,"context_line":"    return portgroups + sorted_ports"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"class VIFPortIDMixin(object):"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_3be3d9a5","line":95,"updated":"2017-01-11 20:01:15.000000000","message":"This looks nice, thank you!\n\nI wonder if it would be better just to return the first in the list. And if that will be a portgroup, we could skip the sorted() call too.","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"622252b2155fe29437cc1f185f6df9ff09708e0c","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    # first"},{"line_number":93,"context_line":"    sorted_ports \u003d sorted(ports, key\u003dlambda p: p.pxe_enabled, reverse\u003dTrue)"},{"line_number":94,"context_line":"    # portgroups are higher priority"},{"line_number":95,"context_line":"    return portgroups + sorted_ports"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"class VIFPortIDMixin(object):"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_a7096a86","line":95,"in_reply_to":"","updated":"2017-01-11 21:35:21.000000000","message":"ew, extra method, extra tests :) can do, yeah. will think about that. was kind of thinking about nova scheduler when doing this :)","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"94cef02d0d2a366bdb052ca4426ff1fad8ada754","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    # first"},{"line_number":93,"context_line":"    sorted_ports \u003d sorted(ports, key\u003dlambda p: p.pxe_enabled, reverse\u003dTrue)"},{"line_number":94,"context_line":"    # portgroups are higher priority"},{"line_number":95,"context_line":"    return portgroups + sorted_ports"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"class VIFPortIDMixin(object):"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_4cb9c514","line":95,"in_reply_to":"ba5201f7_3be3d9a5","updated":"2017-01-11 20:59:26.000000000","message":"Yes, that would work too. This method is a bit messy though, in the sense that it does quite a few things, but nothing that documentation can\u0027t address :)","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"994b07e73db19fea4b2b8d1c804789f75947c867","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    # first"},{"line_number":93,"context_line":"    sorted_ports \u003d sorted(ports, key\u003dlambda p: p.pxe_enabled, reverse\u003dTrue)"},{"line_number":94,"context_line":"    # portgroups are higher priority"},{"line_number":95,"context_line":"    return portgroups + sorted_ports"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"class VIFPortIDMixin(object):"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_ec8a79be","line":95,"in_reply_to":"ba5201f7_4cb9c514","updated":"2017-01-11 21:15:47.000000000","message":"I thought about this. Returning all makes testing more clear, as we can check all items returned. Can switch back tho if you prefer.","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"f6454cbdcb8cbcdf662bc1996bbfc8821e608d48","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    # first"},{"line_number":93,"context_line":"    sorted_ports \u003d sorted(ports, key\u003dlambda p: p.pxe_enabled, reverse\u003dTrue)"},{"line_number":94,"context_line":"    # portgroups are higher priority"},{"line_number":95,"context_line":"    return portgroups + sorted_ports"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"class VIFPortIDMixin(object):"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_2c4721bd","line":95,"in_reply_to":"ba5201f7_4cb9c514","updated":"2017-01-11 21:07:48.000000000","message":"So maybe call this method \u0027get_first_free_port_like_object\u0027 ?","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"d86830f9f64fccaebdeb59fd94688e1c8be56894","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    # first"},{"line_number":93,"context_line":"    sorted_ports \u003d sorted(ports, key\u003dlambda p: p.pxe_enabled, reverse\u003dTrue)"},{"line_number":94,"context_line":"    # portgroups are higher priority"},{"line_number":95,"context_line":"    return portgroups + sorted_ports"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"class VIFPortIDMixin(object):"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_c7a10e48","line":95,"in_reply_to":"ba5201f7_a7096a86","updated":"2017-01-11 21:45:59.000000000","message":"It\u0027d be better to return the first but I doubt that a node will have that many ports/portgroups so it doesn\u0027t really matter about the performance hit for the sort etc, so it is fine as-is. Someone can change it later if they want.\n\nAnyway, I don\u0027t have a good idea of what the future holds in store for this code so I don\u0027t feel strongly about it either way. I think the \u0027extra method, extra test\u0027 doesn\u0027t hold, since the code is there, just split up, and you should test the code regardless :)","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"ec9e97bf1e8b65dd088b585d1e0a54cdc1dcb0d3","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    # first"},{"line_number":93,"context_line":"    sorted_ports \u003d sorted(ports, key\u003dlambda p: p.pxe_enabled, reverse\u003dTrue)"},{"line_number":94,"context_line":"    # portgroups are higher priority"},{"line_number":95,"context_line":"    return portgroups + sorted_ports"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"class VIFPortIDMixin(object):"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_c784ae0c","line":95,"in_reply_to":"ba5201f7_ec8a79be","updated":"2017-01-11 21:31:57.000000000","message":"You\u0027re going to hate this but i think it makes sense to only return the first. No need to spend extra time sorting if we don\u0027t have to.\n\nYou could break this into two methods, eg one that just goes up to L89 so you can do testing of that.","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8bb8fcfa571f430acb9592037e9a40c735e299b2","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"def _vif_attached(port_like_obj, vif_id):"},{"line_number":36,"context_line":"    \"\"\"Ensure VIF isn\u0027t already attached to port-like object."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    :param port_like_obj: port-like object to check."},{"line_number":39,"context_line":"    :param vif_id: identifier of the VIF to look for in port_like_obj."},{"line_number":40,"context_line":"    :returns: True if vif_id is attached to port_like_obj, False otherwise."}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_d625c0ae","line":37,"updated":"2017-01-12 15:46:22.000000000","message":"Might want to be clearer since this is doing several things. Maybe add\n\nRaises an exception if a VIF with vif_id is attached to the port-like (Port or Portgroup) object. Otherwise, returns whether a VIF is attached.","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"36b774855b2d5a9eff7fd142bd0e153ba81da76b","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"def _vif_attached(port_like_obj, vif_id):"},{"line_number":36,"context_line":"    \"\"\"Ensure VIF isn\u0027t already attached to port-like object."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    :param port_like_obj: port-like object to check."},{"line_number":39,"context_line":"    :param vif_id: identifier of the VIF to look for in port_like_obj."},{"line_number":40,"context_line":"    :returns: True if vif_id is attached to port_like_obj, False otherwise."}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_2dbf9ad1","line":37,"in_reply_to":"9a57fde8_d625c0ae","updated":"2017-01-12 16:14:15.000000000","message":"Done","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8bb8fcfa571f430acb9592037e9a40c735e299b2","unresolved":false,"context_lines":[{"line_number":35,"context_line":"def _vif_attached(port_like_obj, vif_id):"},{"line_number":36,"context_line":"    \"\"\"Ensure VIF isn\u0027t already attached to port-like object."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    :param port_like_obj: port-like object to check."},{"line_number":39,"context_line":"    :param vif_id: identifier of the VIF to look for in port_like_obj."},{"line_number":40,"context_line":"    :returns: True if vif_id is attached to port_like_obj, False otherwise."},{"line_number":41,"context_line":"    :raises: VifAlreadyAttached, if vif_id is attached to port_like_obj."}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_5b265917","line":38,"updated":"2017-01-12 15:46:22.000000000","message":"nit: s/port-like/port-like (Port or Portgroup)/","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"36b774855b2d5a9eff7fd142bd0e153ba81da76b","unresolved":false,"context_lines":[{"line_number":35,"context_line":"def _vif_attached(port_like_obj, vif_id):"},{"line_number":36,"context_line":"    \"\"\"Ensure VIF isn\u0027t already attached to port-like object."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    :param port_like_obj: port-like object to check."},{"line_number":39,"context_line":"    :param vif_id: identifier of the VIF to look for in port_like_obj."},{"line_number":40,"context_line":"    :returns: True if vif_id is attached to port_like_obj, False otherwise."},{"line_number":41,"context_line":"    :raises: VifAlreadyAttached, if vif_id is attached to port_like_obj."}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_ade46a0d","line":38,"in_reply_to":"9a57fde8_5b265917","updated":"2017-01-12 16:14:15.000000000","message":":( Is it ok if I define it only once in the docstring?","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"06101b509c429dbebd3e92857e198e000b903814","unresolved":false,"context_lines":[{"line_number":35,"context_line":"def _vif_attached(port_like_obj, vif_id):"},{"line_number":36,"context_line":"    \"\"\"Ensure VIF isn\u0027t already attached to port-like object."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    :param port_like_obj: port-like object to check."},{"line_number":39,"context_line":"    :param vif_id: identifier of the VIF to look for in port_like_obj."},{"line_number":40,"context_line":"    :returns: True if vif_id is attached to port_like_obj, False otherwise."},{"line_number":41,"context_line":"    :raises: VifAlreadyAttached, if vif_id is attached to port_like_obj."}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_c0adf589","line":38,"in_reply_to":"9a57fde8_ade46a0d","updated":"2017-01-12 16:31:22.000000000","message":"yup, i wrote this comment before i added the other one and forgot to delete this one.","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"e17c413485de554ee72918d21cafe356540a6e7d","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    :param port_like_obj: port-like object to check."},{"line_number":39,"context_line":"    :param vif_id: identifier of the VIF to look for in port_like_obj."},{"line_number":40,"context_line":"    :returns: True if vif_id is attached to port_like_obj, False otherwise."},{"line_number":41,"context_line":"    :raises: VifAlreadyAttached, if vif_id is attached to port_like_obj."},{"line_number":42,"context_line":"    \"\"\""},{"line_number":43,"context_line":"    attached_vif_id \u003d port_like_obj.internal_info.get("}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_e4e85619","line":40,"range":{"start_line":40,"start_character":4,"end_line":40,"end_character":28},"updated":"2017-01-12 15:32:28.000000000","message":"True if other than passed vif_id is attached to specified port.","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8bb8fcfa571f430acb9592037e9a40c735e299b2","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    :param port_like_obj: port-like object to check."},{"line_number":39,"context_line":"    :param vif_id: identifier of the VIF to look for in port_like_obj."},{"line_number":40,"context_line":"    :returns: True if vif_id is attached to port_like_obj, False otherwise."},{"line_number":41,"context_line":"    :raises: VifAlreadyAttached, if vif_id is attached to port_like_obj."},{"line_number":42,"context_line":"    \"\"\""},{"line_number":43,"context_line":"    attached_vif_id \u003d port_like_obj.internal_info.get("}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_bb4bc5af","line":40,"updated":"2017-01-12 15:46:22.000000000","message":"not quite. True if a VIF (but not vif_id) is attached...","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"11993f43e53303f170c587b352866ff7a30c50fe","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    :param port_like_obj: port-like object to check."},{"line_number":39,"context_line":"    :param vif_id: identifier of the VIF to look for in port_like_obj."},{"line_number":40,"context_line":"    :returns: True if vif_id is attached to port_like_obj, False otherwise."},{"line_number":41,"context_line":"    :raises: VifAlreadyAttached, if vif_id is attached to port_like_obj."},{"line_number":42,"context_line":"    \"\"\""},{"line_number":43,"context_line":"    attached_vif_id \u003d port_like_obj.internal_info.get("}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_b67e7cac","line":40,"range":{"start_line":40,"start_character":4,"end_line":40,"end_character":28},"in_reply_to":"9a57fde8_e4e85619","updated":"2017-01-12 15:48:43.000000000","message":"Done","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8bb8fcfa571f430acb9592037e9a40c735e299b2","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    :returns: tuple of: list of free ports, set of non-usable portgroups\u0027 IDs,"},{"line_number":58,"context_line":"        dictionary of portgroup IDs to their free ports mapping."},{"line_number":59,"context_line":"    :raises: VifAlreadyAttached, if vif_id is attached to any of the"},{"line_number":60,"context_line":"        node\u0027s port."},{"line_number":61,"context_line":"    \"\"\""},{"line_number":62,"context_line":"    # This list contains ports selected as candidates for attachment"},{"line_number":63,"context_line":"    free_ports \u003d []"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_766fb492","line":60,"updated":"2017-01-12 15:46:22.000000000","message":"s/port/ports/.\n\nOr you can change it to \u0027if vif_id is already attached to the node.\u0027","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"36b774855b2d5a9eff7fd142bd0e153ba81da76b","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    :returns: tuple of: list of free ports, set of non-usable portgroups\u0027 IDs,"},{"line_number":58,"context_line":"        dictionary of portgroup IDs to their free ports mapping."},{"line_number":59,"context_line":"    :raises: VifAlreadyAttached, if vif_id is attached to any of the"},{"line_number":60,"context_line":"        node\u0027s port."},{"line_number":61,"context_line":"    \"\"\""},{"line_number":62,"context_line":"    # This list contains ports selected as candidates for attachment"},{"line_number":63,"context_line":"    free_ports \u003d []"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_aa2290b7","line":60,"in_reply_to":"9a57fde8_766fb492","updated":"2017-01-12 16:14:15.000000000","message":"changed to ports.","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8bb8fcfa571f430acb9592037e9a40c735e299b2","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    :param vif_id: Name or UUID of a VIF."},{"line_number":91,"context_line":"    :param free_ports: list of free ports."},{"line_number":92,"context_line":"    :param non_usable_portgroups: set of non-usable portgroups\u0027 IDs."},{"line_number":93,"context_line":"    :param ports_by_portgroup: dictionary of portgroup IDs to their free ports"},{"line_number":94,"context_line":"        mapping."},{"line_number":95,"context_line":"    :returns: list of free portgroups."},{"line_number":96,"context_line":"    :raises: VifAlreadyAttached, if vif_id is attached to any of the"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_76925459","line":93,"updated":"2017-01-12 15:46:22.000000000","message":"s/free ports/(list of) free ports/","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"36b774855b2d5a9eff7fd142bd0e153ba81da76b","unresolved":false,"context_lines":[{"line_number":90,"context_line":"    :param vif_id: Name or UUID of a VIF."},{"line_number":91,"context_line":"    :param free_ports: list of free ports."},{"line_number":92,"context_line":"    :param non_usable_portgroups: set of non-usable portgroups\u0027 IDs."},{"line_number":93,"context_line":"    :param ports_by_portgroup: dictionary of portgroup IDs to their free ports"},{"line_number":94,"context_line":"        mapping."},{"line_number":95,"context_line":"    :returns: list of free portgroups."},{"line_number":96,"context_line":"    :raises: VifAlreadyAttached, if vif_id is attached to any of the"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_ea55781d","line":93,"in_reply_to":"9a57fde8_76925459","updated":"2017-01-12 16:14:15.000000000","message":"Done","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8bb8fcfa571f430acb9592037e9a40c735e299b2","unresolved":false,"context_lines":[{"line_number":91,"context_line":"    :param free_ports: list of free ports."},{"line_number":92,"context_line":"    :param non_usable_portgroups: set of non-usable portgroups\u0027 IDs."},{"line_number":93,"context_line":"    :param ports_by_portgroup: dictionary of portgroup IDs to their free ports"},{"line_number":94,"context_line":"        mapping."},{"line_number":95,"context_line":"    :returns: list of free portgroups."},{"line_number":96,"context_line":"    :raises: VifAlreadyAttached, if vif_id is attached to any of the"},{"line_number":97,"context_line":"        node\u0027s portgroups."}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_36b52ccd","line":94,"updated":"2017-01-12 15:46:22.000000000","message":"Ugh. Wondering if we need to mention that s/dictionary/(collections.defaultdict) dictionary/.","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"36b774855b2d5a9eff7fd142bd0e153ba81da76b","unresolved":false,"context_lines":[{"line_number":91,"context_line":"    :param free_ports: list of free ports."},{"line_number":92,"context_line":"    :param non_usable_portgroups: set of non-usable portgroups\u0027 IDs."},{"line_number":93,"context_line":"    :param ports_by_portgroup: dictionary of portgroup IDs to their free ports"},{"line_number":94,"context_line":"        mapping."},{"line_number":95,"context_line":"    :returns: list of free portgroups."},{"line_number":96,"context_line":"    :raises: VifAlreadyAttached, if vif_id is attached to any of the"},{"line_number":97,"context_line":"        node\u0027s portgroups."}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_aaf610d5","line":94,"in_reply_to":"9a57fde8_36b52ccd","updated":"2017-01-12 16:14:15.000000000","message":"mm, not sure we need to go in such detail, otherwise we\u0027d need to say collections.defaultdict(list), which is code actually :)","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"06101b509c429dbebd3e92857e198e000b903814","unresolved":false,"context_lines":[{"line_number":91,"context_line":"    :param free_ports: list of free ports."},{"line_number":92,"context_line":"    :param non_usable_portgroups: set of non-usable portgroups\u0027 IDs."},{"line_number":93,"context_line":"    :param ports_by_portgroup: dictionary of portgroup IDs to their free ports"},{"line_number":94,"context_line":"        mapping."},{"line_number":95,"context_line":"    :returns: list of free portgroups."},{"line_number":96,"context_line":"    :raises: VifAlreadyAttached, if vif_id is attached to any of the"},{"line_number":97,"context_line":"        node\u0027s portgroups."}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_a0ce3158","line":94,"in_reply_to":"9a57fde8_aaf610d5","updated":"2017-01-12 16:31:22.000000000","message":"yeah. just that someone might trip on the same thing i did before, thinking it was a normal dictionary. (eg, L108 working if pg.id is not in ports_by_portgroup)","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8bb8fcfa571f430acb9592037e9a40c735e299b2","unresolved":false,"context_lines":[{"line_number":116,"context_line":"def get_free_port_like_object(task, vif_id):"},{"line_number":117,"context_line":"    \"\"\"Returns free port-like object VIF will be attached to."},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    Ensure that VIF is not already attached to this node."},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    :param task: a TaskManager instance."},{"line_number":122,"context_line":"    :param vif_id: Name or UUID of a VIF."}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_5b72d97d","line":119,"updated":"2017-01-12 15:46:22.000000000","message":"nit: it should be obvious but for first-time readers, might be good to mention that a port-like object is a Port or Portgroup. (I keep wondering why we didn\u0027t use some sort of parent class for them...)","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"36b774855b2d5a9eff7fd142bd0e153ba81da76b","unresolved":false,"context_lines":[{"line_number":116,"context_line":"def get_free_port_like_object(task, vif_id):"},{"line_number":117,"context_line":"    \"\"\"Returns free port-like object VIF will be attached to."},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    Ensure that VIF is not already attached to this node."},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    :param task: a TaskManager instance."},{"line_number":122,"context_line":"    :param vif_id: Name or UUID of a VIF."}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_8adb0ced","line":119,"in_reply_to":"9a57fde8_5b72d97d","updated":"2017-01-12 16:14:15.000000000","message":"Done","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8bb8fcfa571f430acb9592037e9a40c735e299b2","unresolved":false,"context_lines":[{"line_number":117,"context_line":"    \"\"\"Returns free port-like object VIF will be attached to."},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    Ensure that VIF is not already attached to this node."},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    :param task: a TaskManager instance."},{"line_number":122,"context_line":"    :param vif_id: Name or UUID of a VIF."},{"line_number":123,"context_line":"    :raises: VifAlreadyAttached, if VIF is already attached."}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_fb08ed93","line":120,"updated":"2017-01-12 15:46:22.000000000","message":"would be good to copy the documentation from L290-292 since this is where the logic is being done.","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"36b774855b2d5a9eff7fd142bd0e153ba81da76b","unresolved":false,"context_lines":[{"line_number":117,"context_line":"    \"\"\"Returns free port-like object VIF will be attached to."},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    Ensure that VIF is not already attached to this node."},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    :param task: a TaskManager instance."},{"line_number":122,"context_line":"    :param vif_id: Name or UUID of a VIF."},{"line_number":123,"context_line":"    :raises: VifAlreadyAttached, if VIF is already attached."}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_2a65c044","line":120,"in_reply_to":"9a57fde8_fb08ed93","updated":"2017-01-12 16:14:15.000000000","message":"Done","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8bb8fcfa571f430acb9592037e9a40c735e299b2","unresolved":false,"context_lines":[{"line_number":130,"context_line":"    free_ports, non_usable_portgroups, ports_by_portgroup \u003d res"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    free_portgroups \u003d _get_candidate_portgroups_and_extend_candidate_ports("},{"line_number":133,"context_line":"        task, vif_id, free_ports, non_usable_portgroups, ports_by_portgroup)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    if free_portgroups:"},{"line_number":136,"context_line":"        # portgroups are higher priority"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_5689d0c9","line":133,"updated":"2017-01-12 15:46:22.000000000","message":"I think (but maybe not worth changing) that if you combined the two methods into one that it might be easier to describe/understand. I don\u0027t know that the intermediate res is necessary here.\n\neg free_portgroups, free_ports \u003d _get_available_portgroups_and_ports()","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"36b774855b2d5a9eff7fd142bd0e153ba81da76b","unresolved":false,"context_lines":[{"line_number":130,"context_line":"    free_ports, non_usable_portgroups, ports_by_portgroup \u003d res"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    free_portgroups \u003d _get_candidate_portgroups_and_extend_candidate_ports("},{"line_number":133,"context_line":"        task, vif_id, free_ports, non_usable_portgroups, ports_by_portgroup)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    if free_portgroups:"},{"line_number":136,"context_line":"        # portgroups are higher priority"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_4ab6848b","line":133,"in_reply_to":"9a57fde8_5689d0c9","updated":"2017-01-12 16:14:15.000000000","message":"Well, I\u0027ve renamed them, it\u0027s more logical separation, first iterates on ports, and decides based on them, second - on portgroups.","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8bb8fcfa571f430acb9592037e9a40c735e299b2","unresolved":false,"context_lines":[{"line_number":140,"context_line":"    # first"},{"line_number":141,"context_line":"    sorted_free_ports \u003d sorted(free_ports, key\u003dlambda p: p.pxe_enabled,"},{"line_number":142,"context_line":"                               reverse\u003dTrue)"},{"line_number":143,"context_line":"    if sorted_free_ports:"},{"line_number":144,"context_line":"        return sorted_free_ports[0]"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    raise exception.NoFreePhysicalPorts(vif\u003dvif_id)"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_3b87d510","line":143,"updated":"2017-01-12 15:46:22.000000000","message":"nit: this can be moved before L141. No need to sort if there are no free_ports.","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"36b774855b2d5a9eff7fd142bd0e153ba81da76b","unresolved":false,"context_lines":[{"line_number":140,"context_line":"    # first"},{"line_number":141,"context_line":"    sorted_free_ports \u003d sorted(free_ports, key\u003dlambda p: p.pxe_enabled,"},{"line_number":142,"context_line":"                               reverse\u003dTrue)"},{"line_number":143,"context_line":"    if sorted_free_ports:"},{"line_number":144,"context_line":"        return sorted_free_ports[0]"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    raise exception.NoFreePhysicalPorts(vif\u003dvif_id)"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_aaad3033","line":143,"in_reply_to":"9a57fde8_3b87d510","updated":"2017-01-12 16:14:15.000000000","message":"good point!","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"928d89713d55a820ce742b1d6a453b2b5c8274a4","unresolved":false,"context_lines":[{"line_number":129,"context_line":"    res \u003d _check_ports(task, vif_id)"},{"line_number":130,"context_line":"    free_ports, non_usable_portgroups, ports_by_portgroup \u003d res"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    free_portgroups \u003d _check_portgroups_and_extend_ports("},{"line_number":133,"context_line":"        task, vif_id, free_ports, non_usable_portgroups, ports_by_portgroup)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    if free_portgroups:"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a57fde8_0388e721","line":132,"updated":"2017-01-12 16:49:30.000000000","message":"I\u0027m not sure why you renamed them from _get_* to _check_*. I thought we tend to use check_* to check something that raises an exception with no return value. These methods are doing more than checking (the only real check is if vif_id is already attached).\n\nReally, if we were to think of logical steps\n1. check that vif_id is not already attached\n2. get a portgroup or port to attach vif\n3. attach vif\n\nWe\u0027re combining 1 \u0026 2 due to performance (not looping twice). I agree the naming of the two methods is hard -- but if i had to choose \u0027_check\u0027 or \u0027_get\u0027, I\u0027d go with \u0027_get\u0027 since it is actually returning information and one can view the check as being a side effect.\n\nThis is one reason why i suggested just combining into one method, so only one name is needed and the method itself can have comments to explain what is going on.\n\nOne of the other problems with splitting into two is if we decide to change the algorithm wrt how we select the first port-like-object. Which could affect both _check_ports and _check_portgroups_and_extend_ports.\n\nAnyway, just my thoughts :)","commit_id":"39c53fb6a42ab9a319252a3cb9e7a5e6166203a8"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"776b1e41a95fc4f5bc7e8cd778ac41f1e2102c97","unresolved":false,"context_lines":[{"line_number":129,"context_line":"    res \u003d _check_ports(task, vif_id)"},{"line_number":130,"context_line":"    free_ports, non_usable_portgroups, ports_by_portgroup \u003d res"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    free_portgroups \u003d _check_portgroups_and_extend_ports("},{"line_number":133,"context_line":"        task, vif_id, free_ports, non_usable_portgroups, ports_by_portgroup)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    if free_portgroups:"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a57fde8_793a40cf","line":132,"in_reply_to":"9a57fde8_0388e721","updated":"2017-01-12 17:16:01.000000000","message":"Done","commit_id":"39c53fb6a42ab9a319252a3cb9e7a5e6166203a8"}],"ironic/drivers/modules/network/flat.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"197e8d4915fbd0110b0639a4d152c37ecc2b16b9","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            return"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        client \u003d neutron.get_client(task.context.auth_token)"},{"line_number":73,"context_line":"        for port_like_obj in task.ports + task.portgroups:"},{"line_number":74,"context_line":"            vif_port_id \u003d ("},{"line_number":75,"context_line":"                port_like_obj.internal_info.get(\u0027tenant_vif_port_id\u0027) or"},{"line_number":76,"context_line":"                port_like_obj.extra.get(\u0027vif_port_id\u0027)"}],"source_content_type":"text/x-python","patch_set":22,"id":"7a3c09a3_124b7ab1","line":73,"updated":"2017-01-16 16:18:02.000000000","message":"just want to check since I don\u0027t recall the details. The original code\u0027s comments from sambetts (and I don\u0027t know how accurate that is) is only looking at ports that are not associated with a port group. This looks at all ports and all portgroups.","commit_id":"b83af0d65a9a06691a6e9bd716b9f17fff0856ed"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"4d52a1cac73997b2eb4b9a412a3ccf9919047303","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            return"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        client \u003d neutron.get_client(task.context.auth_token)"},{"line_number":73,"context_line":"        for port_like_obj in task.ports + task.portgroups:"},{"line_number":74,"context_line":"            vif_port_id \u003d ("},{"line_number":75,"context_line":"                port_like_obj.internal_info.get(\u0027tenant_vif_port_id\u0027) or"},{"line_number":76,"context_line":"                port_like_obj.extra.get(\u0027vif_port_id\u0027)"}],"source_content_type":"text/x-python","patch_set":22,"id":"7a3c09a3_ed6d2f99","line":73,"in_reply_to":"7a3c09a3_124b7ab1","updated":"2017-01-16 16:20:57.000000000","message":"Yeah, now the portgroup selection logic is much more complex as you can see from the common module function, and it\u0027s in fact possible to have vif attached to a port inside portgroup. There is no harm in iterating on all of them I think, instead of complicating the logic further here.","commit_id":"b83af0d65a9a06691a6e9bd716b9f17fff0856ed"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"75a2672ffb49cac3aafc1d81261372141e7efb8a","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            return"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        client \u003d neutron.get_client(task.context.auth_token)"},{"line_number":73,"context_line":"        for port_like_obj in task.ports + task.portgroups:"},{"line_number":74,"context_line":"            vif_port_id \u003d ("},{"line_number":75,"context_line":"                port_like_obj.internal_info.get(\u0027tenant_vif_port_id\u0027) or"},{"line_number":76,"context_line":"                port_like_obj.extra.get(\u0027vif_port_id\u0027)"}],"source_content_type":"text/x-python","patch_set":22,"id":"7a3c09a3_1fd4621e","line":73,"in_reply_to":"7a3c09a3_ed6d2f99","updated":"2017-01-16 16:36:02.000000000","message":"ok","commit_id":"b83af0d65a9a06691a6e9bd716b9f17fff0856ed"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"2946ad664cfc1627d8681667f01cfbe93ed886f7","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        client \u003d neutron.get_client(task.context.auth_token)"},{"line_number":73,"context_line":"        for port_like_obj in task.ports + task.portgroups:"},{"line_number":74,"context_line":"            vif_port_id \u003d ("},{"line_number":75,"context_line":"                port_like_obj.internal_info.get(\u0027tenant_vif_port_id\u0027) or"},{"line_number":76,"context_line":"                port_like_obj.extra.get(\u0027vif_port_id\u0027)"},{"line_number":77,"context_line":"            )"},{"line_number":78,"context_line":"            if not vif_port_id:"}],"source_content_type":"text/x-python","patch_set":22,"id":"7a3c09a3_47961440","line":75,"updated":"2017-01-16 20:07:29.000000000","message":"Don\u0027t we have a constant for this?","commit_id":"b83af0d65a9a06691a6e9bd716b9f17fff0856ed"}],"ironic/tests/unit/drivers/modules/network/test_common.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8b489d3b5844c3320f7a3cb37d7c25d8e0bfac17","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            self.interface.vif_attach(task, vif)"},{"line_number":92,"context_line":"            pg.refresh()"},{"line_number":93,"context_line":"            self.assertEqual(pg.internal_info.get("},{"line_number":94,"context_line":"                common.TENANT_VIF_KEY), vif[\u0027id\u0027])"},{"line_number":95,"context_line":"            mock_upa.assert_called_once_with(vif[\u0027id\u0027], pg.address)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    @mock.patch.object(neutron_common, \u0027get_client\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da4df55a_bd88f8e8","line":94,"updated":"2016-12-22 23:04:57.000000000","message":"other way: .assertEqual(expected, actual)","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"9abffc00afc80806775470eb7fe7456034f4b3ab","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            self.interface.vif_attach(task, vif)"},{"line_number":92,"context_line":"            pg.refresh()"},{"line_number":93,"context_line":"            self.assertEqual(pg.internal_info.get("},{"line_number":94,"context_line":"                common.TENANT_VIF_KEY), vif[\u0027id\u0027])"},{"line_number":95,"context_line":"            mock_upa.assert_called_once_with(vif[\u0027id\u0027], pg.address)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    @mock.patch.object(neutron_common, \u0027get_client\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da4df55a_7510205a","line":94,"in_reply_to":"da4df55a_bd88f8e8","updated":"2016-12-26 12:48:11.000000000","message":"Done","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8b489d3b5844c3320f7a3cb37d7c25d8e0bfac17","unresolved":false,"context_lines":[{"line_number":106,"context_line":"            self.interface.vif_attach(task, vif)"},{"line_number":107,"context_line":"            pg.refresh()"},{"line_number":108,"context_line":"            self.assertEqual(pg.internal_info.get("},{"line_number":109,"context_line":"                common.TENANT_VIF_KEY), vif[\u0027id\u0027])"},{"line_number":110,"context_line":"            self.assertFalse(mock_upa.called)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    @mock.patch.object(neutron_common, \u0027get_client\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da4df55a_5d60ec35","line":109,"updated":"2016-12-22 23:04:57.000000000","message":"ditto","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"9abffc00afc80806775470eb7fe7456034f4b3ab","unresolved":false,"context_lines":[{"line_number":106,"context_line":"            self.interface.vif_attach(task, vif)"},{"line_number":107,"context_line":"            pg.refresh()"},{"line_number":108,"context_line":"            self.assertEqual(pg.internal_info.get("},{"line_number":109,"context_line":"                common.TENANT_VIF_KEY), vif[\u0027id\u0027])"},{"line_number":110,"context_line":"            self.assertFalse(mock_upa.called)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    @mock.patch.object(neutron_common, \u0027get_client\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da4df55a_9515844a","line":109,"in_reply_to":"da4df55a_5d60ec35","updated":"2016-12-26 12:48:11.000000000","message":"Done","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8b489d3b5844c3320f7a3cb37d7c25d8e0bfac17","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            pg.refresh()"},{"line_number":108,"context_line":"            self.assertEqual(pg.internal_info.get("},{"line_number":109,"context_line":"                common.TENANT_VIF_KEY), vif[\u0027id\u0027])"},{"line_number":110,"context_line":"            self.assertFalse(mock_upa.called)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    @mock.patch.object(neutron_common, \u0027get_client\u0027)"},{"line_number":113,"context_line":"    @mock.patch.object(neutron_common, \u0027update_port_address\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da4df55a_5dc70c12","line":110,"updated":"2016-12-22 23:04:57.000000000","message":"mock_client wasn\u0027t called either","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"9abffc00afc80806775470eb7fe7456034f4b3ab","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            pg.refresh()"},{"line_number":108,"context_line":"            self.assertEqual(pg.internal_info.get("},{"line_number":109,"context_line":"                common.TENANT_VIF_KEY), vif[\u0027id\u0027])"},{"line_number":110,"context_line":"            self.assertFalse(mock_upa.called)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    @mock.patch.object(neutron_common, \u0027get_client\u0027)"},{"line_number":113,"context_line":"    @mock.patch.object(neutron_common, \u0027update_port_address\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da4df55a_d50b8c28","line":110,"in_reply_to":"da4df55a_5dc70c12","updated":"2016-12-26 12:48:11.000000000","message":"Done","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8b489d3b5844c3320f7a3cb37d7c25d8e0bfac17","unresolved":false,"context_lines":[{"line_number":108,"context_line":"            self.assertEqual(pg.internal_info.get("},{"line_number":109,"context_line":"                common.TENANT_VIF_KEY), vif[\u0027id\u0027])"},{"line_number":110,"context_line":"            self.assertFalse(mock_upa.called)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    @mock.patch.object(neutron_common, \u0027get_client\u0027)"},{"line_number":113,"context_line":"    @mock.patch.object(neutron_common, \u0027update_port_address\u0027)"},{"line_number":114,"context_line":"    def test_vif_attach_update_port_exception(self, mock_upa, mock_client):"}],"source_content_type":"text/x-python","patch_set":7,"id":"da4df55a_bded588d","line":111,"updated":"2016-12-22 23:04:57.000000000","message":"would be good to have two? tests to deal with the logic used when there are portgroups and ports. Hmm, with vif, without vif. Guess it could be more than 2. not sure how much we want to test...","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8b489d3b5844c3320f7a3cb37d7c25d8e0bfac17","unresolved":false,"context_lines":[{"line_number":158,"context_line":"                exception.VifAlreadyAttached, \"already attached\","},{"line_number":159,"context_line":"                self.interface.vif_attach, task, vif)"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    def test_vif_detach_in_extra(self):"},{"line_number":162,"context_line":"        with task_manager.acquire(self.context, self.node.id) as task:"},{"line_number":163,"context_line":"            self.interface.vif_detach("},{"line_number":164,"context_line":"                task, self.port.extra[\u0027vif_port_id\u0027])"}],"source_content_type":"text/x-python","patch_set":7,"id":"da4df55a_fd2280b8","line":161,"updated":"2016-12-22 23:04:57.000000000","message":"do we want to test vif_detach with portgroups?","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"9abffc00afc80806775470eb7fe7456034f4b3ab","unresolved":false,"context_lines":[{"line_number":158,"context_line":"                exception.VifAlreadyAttached, \"already attached\","},{"line_number":159,"context_line":"                self.interface.vif_attach, task, vif)"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    def test_vif_detach_in_extra(self):"},{"line_number":162,"context_line":"        with task_manager.acquire(self.context, self.node.id) as task:"},{"line_number":163,"context_line":"            self.interface.vif_detach("},{"line_number":164,"context_line":"                task, self.port.extra[\u0027vif_port_id\u0027])"}],"source_content_type":"text/x-python","patch_set":7,"id":"da4df55a_1502740b","line":161,"in_reply_to":"da4df55a_fd2280b8","updated":"2016-12-26 12:48:11.000000000","message":"Done","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"c2670dd47e282f024cda1793515d6d60000e10f2","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            address\u003d\u002752:54:00:cf:2d:01\u0027, uuid\u003duuidutils.generate_uuid())"},{"line_number":58,"context_line":"        with task_manager.acquire(self.context, self.node.id) as task:"},{"line_number":59,"context_line":"            vifs \u003d self.interface.vif_list(task)"},{"line_number":60,"context_line":"            self.assertItemsEqual(vifs, [{\u0027id\u0027: pg_vif_id}, {\u0027id\u0027: vif_id}])"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def test_vif_list_internal(self):"},{"line_number":63,"context_line":"        vif_id \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5201f7_292113fd","line":60,"updated":"2017-01-10 19:38:09.000000000","message":"I\u0027m not sure, is it self.assertItemsEqual(expected, actual)? If so, this needs to be reversed.","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"c58edcb89d8358dc06cf1388ca4465a7594c30b3","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            address\u003d\u002752:54:00:cf:2d:01\u0027, uuid\u003duuidutils.generate_uuid())"},{"line_number":58,"context_line":"        with task_manager.acquire(self.context, self.node.id) as task:"},{"line_number":59,"context_line":"            vifs \u003d self.interface.vif_list(task)"},{"line_number":60,"context_line":"            self.assertItemsEqual(vifs, [{\u0027id\u0027: pg_vif_id}, {\u0027id\u0027: vif_id}])"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def test_vif_list_internal(self):"},{"line_number":63,"context_line":"        vif_id \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5201f7_b6e70211","line":60,"in_reply_to":"ba5201f7_292113fd","updated":"2017-01-11 10:13:29.000000000","message":"Done","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"c2670dd47e282f024cda1793515d6d60000e10f2","unresolved":false,"context_lines":[{"line_number":73,"context_line":"            address\u003d\u002752:54:00:cf:2d:01\u0027, uuid\u003duuidutils.generate_uuid())"},{"line_number":74,"context_line":"        with task_manager.acquire(self.context, self.node.id) as task:"},{"line_number":75,"context_line":"            vifs \u003d self.interface.vif_list(task)"},{"line_number":76,"context_line":"            self.assertItemsEqual(vifs, [{\u0027id\u0027: pg_vif_id}, {\u0027id\u0027: vif_id}])"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def test_vif_list_extra_and_internal_priority(self):"},{"line_number":79,"context_line":"        vif_id \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5201f7_a97b43f3","line":76,"updated":"2017-01-10 19:38:09.000000000","message":"ditto","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"c58edcb89d8358dc06cf1388ca4465a7594c30b3","unresolved":false,"context_lines":[{"line_number":73,"context_line":"            address\u003d\u002752:54:00:cf:2d:01\u0027, uuid\u003duuidutils.generate_uuid())"},{"line_number":74,"context_line":"        with task_manager.acquire(self.context, self.node.id) as task:"},{"line_number":75,"context_line":"            vifs \u003d self.interface.vif_list(task)"},{"line_number":76,"context_line":"            self.assertItemsEqual(vifs, [{\u0027id\u0027: pg_vif_id}, {\u0027id\u0027: vif_id}])"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def test_vif_list_extra_and_internal_priority(self):"},{"line_number":79,"context_line":"        vif_id \u003d uuidutils.generate_uuid()"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5201f7_76dd9a41","line":76,"in_reply_to":"ba5201f7_a97b43f3","updated":"2017-01-11 10:13:29.000000000","message":"Done","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"c2670dd47e282f024cda1793515d6d60000e10f2","unresolved":false,"context_lines":[{"line_number":111,"context_line":"            self.interface.vif_attach(task, vif)"},{"line_number":112,"context_line":"            pg.refresh()"},{"line_number":113,"context_line":"            self.assertEqual(vif[\u0027id\u0027],"},{"line_number":114,"context_line":"                             pg.internal_info.get(common.TENANT_VIF_KEY))"},{"line_number":115,"context_line":"            mock_upa.assert_called_once_with(vif[\u0027id\u0027], pg.address)"},{"line_number":116,"context_line":"            mock_client.assert_called_once_with(None)"},{"line_number":117,"context_line":"            mock_client.return_value.show_port.assert_called_once_with("}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5201f7_69495bb7","line":114,"updated":"2017-01-10 19:38:09.000000000","message":"We are testing that this exists, right? So it should be pg.internal_info[common.TENANT_VIF_KEY]","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"c58edcb89d8358dc06cf1388ca4465a7594c30b3","unresolved":false,"context_lines":[{"line_number":111,"context_line":"            self.interface.vif_attach(task, vif)"},{"line_number":112,"context_line":"            pg.refresh()"},{"line_number":113,"context_line":"            self.assertEqual(vif[\u0027id\u0027],"},{"line_number":114,"context_line":"                             pg.internal_info.get(common.TENANT_VIF_KEY))"},{"line_number":115,"context_line":"            mock_upa.assert_called_once_with(vif[\u0027id\u0027], pg.address)"},{"line_number":116,"context_line":"            mock_client.assert_called_once_with(None)"},{"line_number":117,"context_line":"            mock_client.return_value.show_port.assert_called_once_with("}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5201f7_16160ef1","line":114,"in_reply_to":"ba5201f7_69495bb7","updated":"2017-01-11 10:13:29.000000000","message":"Done","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"c2670dd47e282f024cda1793515d6d60000e10f2","unresolved":false,"context_lines":[{"line_number":128,"context_line":"            self.interface.vif_attach(task, vif)"},{"line_number":129,"context_line":"            pg.refresh()"},{"line_number":130,"context_line":"            self.assertEqual(vif[\u0027id\u0027],"},{"line_number":131,"context_line":"                             pg.internal_info.get(common.TENANT_VIF_KEY))"},{"line_number":132,"context_line":"            mock_upa.assert_called_once_with(vif[\u0027id\u0027], pg.address)"},{"line_number":133,"context_line":"            mock_client.assert_called_once_with(None)"},{"line_number":134,"context_line":"            mock_client.return_value.show_port.assert_called_once_with("}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5201f7_29abd31f","line":131,"updated":"2017-01-10 19:38:09.000000000","message":"ditto","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"c58edcb89d8358dc06cf1388ca4465a7594c30b3","unresolved":false,"context_lines":[{"line_number":128,"context_line":"            self.interface.vif_attach(task, vif)"},{"line_number":129,"context_line":"            pg.refresh()"},{"line_number":130,"context_line":"            self.assertEqual(vif[\u0027id\u0027],"},{"line_number":131,"context_line":"                             pg.internal_info.get(common.TENANT_VIF_KEY))"},{"line_number":132,"context_line":"            mock_upa.assert_called_once_with(vif[\u0027id\u0027], pg.address)"},{"line_number":133,"context_line":"            mock_client.assert_called_once_with(None)"},{"line_number":134,"context_line":"            mock_client.return_value.show_port.assert_called_once_with("}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5201f7_36d3123a","line":131,"in_reply_to":"ba5201f7_29abd31f","updated":"2017-01-11 10:13:29.000000000","message":"Done","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"c2670dd47e282f024cda1793515d6d60000e10f2","unresolved":false,"context_lines":[{"line_number":146,"context_line":"            self.interface.vif_attach(task, vif)"},{"line_number":147,"context_line":"            pg.refresh()"},{"line_number":148,"context_line":"            self.assertEqual(vif[\u0027id\u0027],"},{"line_number":149,"context_line":"                             pg.internal_info.get(common.TENANT_VIF_KEY))"},{"line_number":150,"context_line":"            self.assertFalse(mock_upa.called)"},{"line_number":151,"context_line":"            self.assertFalse(mock_client.called)"},{"line_number":152,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5201f7_2972f3e3","line":149,"updated":"2017-01-10 19:38:09.000000000","message":"ditto","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"c58edcb89d8358dc06cf1388ca4465a7594c30b3","unresolved":false,"context_lines":[{"line_number":146,"context_line":"            self.interface.vif_attach(task, vif)"},{"line_number":147,"context_line":"            pg.refresh()"},{"line_number":148,"context_line":"            self.assertEqual(vif[\u0027id\u0027],"},{"line_number":149,"context_line":"                             pg.internal_info.get(common.TENANT_VIF_KEY))"},{"line_number":150,"context_line":"            self.assertFalse(mock_upa.called)"},{"line_number":151,"context_line":"            self.assertFalse(mock_client.called)"},{"line_number":152,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"ba5201f7_56d6d627","line":149,"in_reply_to":"ba5201f7_2972f3e3","updated":"2017-01-11 10:13:29.000000000","message":"Done","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"95dcae662d4f2b2f0c0fecbf8f0b6c2e5ab43aff","unresolved":false,"context_lines":[{"line_number":137,"context_line":"    @mock.patch.object(neutron_common, \u0027get_client\u0027)"},{"line_number":138,"context_line":"    @mock.patch.object(neutron_common, \u0027update_port_address\u0027)"},{"line_number":139,"context_line":"    def test_vif_attach_portgroup_ports_already_attached(self, mock_upa,"},{"line_number":140,"context_line":"                                                         mock_client):"},{"line_number":141,"context_line":"        pg \u003d obj_utils.create_test_portgroup("},{"line_number":142,"context_line":"            self.context, node_id\u003dself.node.id)"},{"line_number":143,"context_line":"        obj_utils.create_test_port("}],"source_content_type":"text/x-python","patch_set":11,"id":"ba5201f7_91891dcd","line":140,"updated":"2017-01-11 13:36:28.000000000","message":"This looks like the same test as test_vif_attach_portgroup_first, it seems from the name like we should be trying another attach or something?","commit_id":"b46d82f39211ba907bf7480400761c873dab0acf"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"ce5fdb75568a6293953e1f244f3061699929aaad","unresolved":false,"context_lines":[{"line_number":137,"context_line":"    @mock.patch.object(neutron_common, \u0027get_client\u0027)"},{"line_number":138,"context_line":"    @mock.patch.object(neutron_common, \u0027update_port_address\u0027)"},{"line_number":139,"context_line":"    def test_vif_attach_portgroup_ports_already_attached(self, mock_upa,"},{"line_number":140,"context_line":"                                                         mock_client):"},{"line_number":141,"context_line":"        pg \u003d obj_utils.create_test_portgroup("},{"line_number":142,"context_line":"            self.context, node_id\u003dself.node.id)"},{"line_number":143,"context_line":"        obj_utils.create_test_port("}],"source_content_type":"text/x-python","patch_set":11,"id":"ba5201f7_74b10001","line":140,"in_reply_to":"ba5201f7_235f44e6","updated":"2017-01-11 15:33:07.000000000","message":"There\u0027s no vif attached to this port, though, and you\u0027re checking that it did attach to the portgroup :)","commit_id":"b46d82f39211ba907bf7480400761c873dab0acf"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"4ae0267ffda2d156a498dee6ebb6443171664ab4","unresolved":false,"context_lines":[{"line_number":137,"context_line":"    @mock.patch.object(neutron_common, \u0027get_client\u0027)"},{"line_number":138,"context_line":"    @mock.patch.object(neutron_common, \u0027update_port_address\u0027)"},{"line_number":139,"context_line":"    def test_vif_attach_portgroup_ports_already_attached(self, mock_upa,"},{"line_number":140,"context_line":"                                                         mock_client):"},{"line_number":141,"context_line":"        pg \u003d obj_utils.create_test_portgroup("},{"line_number":142,"context_line":"            self.context, node_id\u003dself.node.id)"},{"line_number":143,"context_line":"        obj_utils.create_test_port("}],"source_content_type":"text/x-python","patch_set":11,"id":"ba5201f7_235f44e6","line":140,"in_reply_to":"ba5201f7_91891dcd","updated":"2017-01-11 15:18:36.000000000","message":"This test was created to check that we do not pick portgroups if it contain port with vif attached to it. Need to update vif_attach logic...","commit_id":"b46d82f39211ba907bf7480400761c873dab0acf"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"95dcae662d4f2b2f0c0fecbf8f0b6c2e5ab43aff","unresolved":false,"context_lines":[{"line_number":636,"context_line":"        pg \u003d obj_utils.create_test_portgroup("},{"line_number":637,"context_line":"            self.context, node_id\u003dself.node.id)"},{"line_number":638,"context_line":"        extra \u003d {\u0027vif_port_id\u0027: \u0027foo\u0027}"},{"line_number":639,"context_line":"        pg.extra \u003d extra"},{"line_number":640,"context_line":"        with task_manager.acquire(self.context, self.node.id) as task:"},{"line_number":641,"context_line":"            self.interface.portgroup_changed(task, pg)"},{"line_number":642,"context_line":"        self.assertFalse(mac_update_mock.call_count)"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba5201f7_f1018907","line":639,"updated":"2017-01-11 13:36:28.000000000","message":"Why not set this in create_test_portgroup?","commit_id":"b46d82f39211ba907bf7480400761c873dab0acf"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"ce5fdb75568a6293953e1f244f3061699929aaad","unresolved":false,"context_lines":[{"line_number":636,"context_line":"        pg \u003d obj_utils.create_test_portgroup("},{"line_number":637,"context_line":"            self.context, node_id\u003dself.node.id)"},{"line_number":638,"context_line":"        extra \u003d {\u0027vif_port_id\u0027: \u0027foo\u0027}"},{"line_number":639,"context_line":"        pg.extra \u003d extra"},{"line_number":640,"context_line":"        with task_manager.acquire(self.context, self.node.id) as task:"},{"line_number":641,"context_line":"            self.interface.portgroup_changed(task, pg)"},{"line_number":642,"context_line":"        self.assertFalse(mac_update_mock.call_count)"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba5201f7_9484a40b","line":639,"in_reply_to":"ba5201f7_a3dc14e5","updated":"2017-01-11 15:33:07.000000000","message":"Ah, good point.","commit_id":"b46d82f39211ba907bf7480400761c873dab0acf"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"4ae0267ffda2d156a498dee6ebb6443171664ab4","unresolved":false,"context_lines":[{"line_number":636,"context_line":"        pg \u003d obj_utils.create_test_portgroup("},{"line_number":637,"context_line":"            self.context, node_id\u003dself.node.id)"},{"line_number":638,"context_line":"        extra \u003d {\u0027vif_port_id\u0027: \u0027foo\u0027}"},{"line_number":639,"context_line":"        pg.extra \u003d extra"},{"line_number":640,"context_line":"        with task_manager.acquire(self.context, self.node.id) as task:"},{"line_number":641,"context_line":"            self.interface.portgroup_changed(task, pg)"},{"line_number":642,"context_line":"        self.assertFalse(mac_update_mock.call_count)"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba5201f7_a3dc14e5","line":639,"in_reply_to":"ba5201f7_f1018907","updated":"2017-01-11 15:18:36.000000000","message":"It will be considered as nothing changed, and portgroup_obj.obj_what_changed() will return None.","commit_id":"b46d82f39211ba907bf7480400761c873dab0acf"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"95dcae662d4f2b2f0c0fecbf8f0b6c2e5ab43aff","unresolved":false,"context_lines":[{"line_number":649,"context_line":"                                                         mock_warn):"},{"line_number":650,"context_line":"        pg \u003d obj_utils.create_test_portgroup("},{"line_number":651,"context_line":"            self.context, node_id\u003dself.node.id, extra\u003d{\u0027vif_port_id\u0027: \u0027foo\u0027})"},{"line_number":652,"context_line":"        pg.extra \u003d {}"},{"line_number":653,"context_line":"        with task_manager.acquire(self.context, self.node.id) as task:"},{"line_number":654,"context_line":"            self.interface.portgroup_changed(task, pg)"},{"line_number":655,"context_line":"        self.assertFalse(mac_update_mock.call_count)"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba5201f7_b120e1b1","line":652,"updated":"2017-01-11 13:36:28.000000000","message":"Why set extra in line 651 if we\u0027re changing it here? Should it be internal_info above?","commit_id":"b46d82f39211ba907bf7480400761c873dab0acf"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"ce5fdb75568a6293953e1f244f3061699929aaad","unresolved":false,"context_lines":[{"line_number":649,"context_line":"                                                         mock_warn):"},{"line_number":650,"context_line":"        pg \u003d obj_utils.create_test_portgroup("},{"line_number":651,"context_line":"            self.context, node_id\u003dself.node.id, extra\u003d{\u0027vif_port_id\u0027: \u0027foo\u0027})"},{"line_number":652,"context_line":"        pg.extra \u003d {}"},{"line_number":653,"context_line":"        with task_manager.acquire(self.context, self.node.id) as task:"},{"line_number":654,"context_line":"            self.interface.portgroup_changed(task, pg)"},{"line_number":655,"context_line":"        self.assertFalse(mac_update_mock.call_count)"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba5201f7_34905843","line":652,"in_reply_to":"ba5201f7_a37894c5","updated":"2017-01-11 15:33:07.000000000","message":"Good point","commit_id":"b46d82f39211ba907bf7480400761c873dab0acf"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"4ae0267ffda2d156a498dee6ebb6443171664ab4","unresolved":false,"context_lines":[{"line_number":649,"context_line":"                                                         mock_warn):"},{"line_number":650,"context_line":"        pg \u003d obj_utils.create_test_portgroup("},{"line_number":651,"context_line":"            self.context, node_id\u003dself.node.id, extra\u003d{\u0027vif_port_id\u0027: \u0027foo\u0027})"},{"line_number":652,"context_line":"        pg.extra \u003d {}"},{"line_number":653,"context_line":"        with task_manager.acquire(self.context, self.node.id) as task:"},{"line_number":654,"context_line":"            self.interface.portgroup_changed(task, pg)"},{"line_number":655,"context_line":"        self.assertFalse(mac_update_mock.call_count)"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba5201f7_a37894c5","line":652,"in_reply_to":"ba5201f7_b120e1b1","updated":"2017-01-11 15:18:36.000000000","message":"This test checks that during vif_port_id key removal from extra, warning is not called. We can\u0027t set empty extra with create_test_port since it will be considered as not changed by portgroup_obj.obj_what_changed()","commit_id":"b46d82f39211ba907bf7480400761c873dab0acf"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"95dcae662d4f2b2f0c0fecbf8f0b6c2e5ab43aff","unresolved":false,"context_lines":[{"line_number":668,"context_line":"        with task_manager.acquire(self.context, self.node.id) as task:"},{"line_number":669,"context_line":"            self.interface.portgroup_changed(task, pg)"},{"line_number":670,"context_line":"        self.assertFalse(mac_update_mock.call_count)"},{"line_number":671,"context_line":"        self.assertEqual(0, mock_warn.called)"},{"line_number":672,"context_line":""},{"line_number":673,"context_line":"    @mock.patch.object(neutron_common, \u0027update_port_address\u0027, autospec\u003dTrue)"},{"line_number":674,"context_line":"    def test_update_portgroup_address_fail(self, mac_update_mock):"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba5201f7_8c6826bc","line":671,"updated":"2017-01-11 13:36:28.000000000","message":"I\u0027m not sure I understand what this is testing, do you mean to assertEqual({\u0027foo\u0027: \u0027bar\u0027}, pg.extra)?","commit_id":"b46d82f39211ba907bf7480400761c873dab0acf"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"8b3b9df95f6f0f0d61376f24469c359da9c3ad48","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        obj_utils.create_test_portgroup(self.context, node_id\u003dself.node.id)"},{"line_number":58,"context_line":"        with task_manager.acquire(self.context, self.node.id) as task:"},{"line_number":59,"context_line":"            res \u003d common.get_free_node_interfaces(task, self.vif_id)"},{"line_number":60,"context_line":"            self.assertEqual(self.port.uuid, res[0].uuid)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def test_get_free_node_interface_ignores_standalone_portgroup(self):"},{"line_number":63,"context_line":"        self.port.destroy()"}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_a6b33099","line":60,"updated":"2017-01-11 20:25:44.000000000","message":"ditto about portgroup.uuid not in res.","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"8b3b9df95f6f0f0d61376f24469c359da9c3ad48","unresolved":false,"context_lines":[{"line_number":73,"context_line":"            uuid\u003duuidutils.generate_uuid(), portgroup_id\u003dpg.id)"},{"line_number":74,"context_line":"        with task_manager.acquire(self.context, self.node.id) as task:"},{"line_number":75,"context_line":"            res \u003d common.get_free_node_interfaces(task, self.vif_id)"},{"line_number":76,"context_line":"            self.assertEqual(free_port.uuid, res[0].uuid)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def test_get_free_node_interface_vif_attached_to_portgroup(self):"},{"line_number":79,"context_line":"        pg \u003d obj_utils.create_test_portgroup("}],"source_content_type":"text/x-python","patch_set":13,"id":"ba5201f7_a6e5f0a4","line":76,"updated":"2017-01-11 20:25:44.000000000","message":"we should check that pg.uuid is not in the res also","commit_id":"6e5ed8d00f069885521a33ec662a42eefdef1507"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"e17c413485de554ee72918d21cafe356540a6e7d","unresolved":false,"context_lines":[{"line_number":71,"context_line":"            portgroup_id\u003dpg3.id)]"},{"line_number":72,"context_line":"        return pg1, pg1_ports, pg2, pg2_ports, pg3, pg3_ports"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def test__get_candidate_ports_and_portgroups_info(self):"},{"line_number":75,"context_line":"        pg1, pg1_ports, pg2, pg2_ports, pg3, pg3_ports \u003d self._objects_setup()"},{"line_number":76,"context_line":"        with task_manager.acquire(self.context, self.node.id) as task:"},{"line_number":77,"context_line":"            res \u003d common._get_candidate_ports_and_portgroups_info(task,"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_3bd6f5c5","line":74,"updated":"2017-01-12 15:32:28.000000000","message":"I think it would be good to have docstring or comment that show port and portgroup relations. Might be something like\n\n{\u0027pg1\u0027: [p1(vif), p2],\n \u0027pg2\u0027: []}","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"11993f43e53303f170c587b352866ff7a30c50fe","unresolved":false,"context_lines":[{"line_number":71,"context_line":"            portgroup_id\u003dpg3.id)]"},{"line_number":72,"context_line":"        return pg1, pg1_ports, pg2, pg2_ports, pg3, pg3_ports"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def test__get_candidate_ports_and_portgroups_info(self):"},{"line_number":75,"context_line":"        pg1, pg1_ports, pg2, pg2_ports, pg3, pg3_ports \u003d self._objects_setup()"},{"line_number":76,"context_line":"        with task_manager.acquire(self.context, self.node.id) as task:"},{"line_number":77,"context_line":"            res \u003d common._get_candidate_ports_and_portgroups_info(task,"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a57fde8_96589858","line":74,"in_reply_to":"9a57fde8_3bd6f5c5","updated":"2017-01-12 15:48:43.000000000","message":"I\u0027ve gone with english :)","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"7747e479a4a35df85a36c5a7fb42e81f8599f41c","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        pg1 \u003d obj_utils.create_test_portgroup("},{"line_number":43,"context_line":"            self.context, node_id\u003dself.node.id)"},{"line_number":44,"context_line":"        pg1_ports \u003d []"},{"line_number":45,"context_line":"        # This portgroup contains 2 ports, both of them without VIF"},{"line_number":46,"context_line":"        for i in range(2):"},{"line_number":47,"context_line":"            pg1_ports.append(obj_utils.create_test_port("},{"line_number":48,"context_line":"                self.context, node_id\u003dself.node.id,"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a57fde8_aa6a9018","line":45,"range":{"start_line":45,"start_character":10,"end_line":45,"end_character":67},"updated":"2017-01-12 16:09:13.000000000","message":"Thank you for the notes :)  We (as a community) really need to get better about doing this kind of thing in complex tests. :)","commit_id":"39c53fb6a42ab9a319252a3cb9e7a5e6166203a8"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"ad0a8174beac8f939d27b1b052cf03e745587000","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        pg2_ports.append(obj_utils.create_test_port("},{"line_number":63,"context_line":"            self.context, node_id\u003dself.node.id,"},{"line_number":64,"context_line":"            address\u003d\u002752:54:00:cf:2d:04\u0027,"},{"line_number":65,"context_line":"            internal_info\u003d{common.TENANT_VIF_KEY: \u0027some-vif\u0027},"},{"line_number":66,"context_line":"            uuid\u003duuidutils.generate_uuid(), portgroup_id\u003dpg2.id))"},{"line_number":67,"context_line":"        # This portgroup has \u0027some-vif-2\u0027 attached to it and contains one port,"},{"line_number":68,"context_line":"        # so neither portgroup nor port can be considered free"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a57fde8_34ffda02","line":65,"updated":"2017-01-12 19:26:39.000000000","message":"should be extra here.","commit_id":"2e15fa93737325978471838741c10d65782d8a51"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"37cbe3e75e1ce19f9c012b8a5902bec984eebea9","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        pg2_ports.append(obj_utils.create_test_port("},{"line_number":63,"context_line":"            self.context, node_id\u003dself.node.id,"},{"line_number":64,"context_line":"            address\u003d\u002752:54:00:cf:2d:04\u0027,"},{"line_number":65,"context_line":"            internal_info\u003d{common.TENANT_VIF_KEY: \u0027some-vif\u0027},"},{"line_number":66,"context_line":"            uuid\u003duuidutils.generate_uuid(), portgroup_id\u003dpg2.id))"},{"line_number":67,"context_line":"        # This portgroup has \u0027some-vif-2\u0027 attached to it and contains one port,"},{"line_number":68,"context_line":"        # so neither portgroup nor port can be considered free"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a57fde8_3f04137d","line":65,"in_reply_to":"9a57fde8_34ffda02","updated":"2017-01-12 20:02:55.000000000","message":"why does it matter if it is extra or internal_info? internal_info is the future...","commit_id":"2e15fa93737325978471838741c10d65782d8a51"},{"author":{"_account_id":13295,"name":"Mario Villaplana","email":"mario.villaplana@gmail.com","username":"mariojv"},"change_message_id":"c72443569cf5103f5690f3905254f8dfe5dbc371","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        pg2_ports.append(obj_utils.create_test_port("},{"line_number":63,"context_line":"            self.context, node_id\u003dself.node.id,"},{"line_number":64,"context_line":"            address\u003d\u002752:54:00:cf:2d:04\u0027,"},{"line_number":65,"context_line":"            internal_info\u003d{common.TENANT_VIF_KEY: \u0027some-vif\u0027},"},{"line_number":66,"context_line":"            uuid\u003duuidutils.generate_uuid(), portgroup_id\u003dpg2.id))"},{"line_number":67,"context_line":"        # This portgroup has \u0027some-vif-2\u0027 attached to it and contains one port,"},{"line_number":68,"context_line":"        # so neither portgroup nor port can be considered free"}],"source_content_type":"text/x-python","patch_set":17,"id":"7a3c09a3_e8590f90","line":65,"in_reply_to":"9a57fde8_3f04137d","updated":"2017-01-12 23:18:54.000000000","message":"I think maybe L124 explains it - precedence?","commit_id":"2e15fa93737325978471838741c10d65782d8a51"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"2dbfe0824edbbd6cf4789a1e8268bd8d450bd4e8","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        self.port.destroy()"},{"line_number":122,"context_line":"        pg \u003d obj_utils.create_test_portgroup("},{"line_number":123,"context_line":"            self.context, node_id\u003dself.node.id,"},{"line_number":124,"context_line":"            standalone_ports_supported\u003dTrue)"},{"line_number":125,"context_line":"        obj_utils.create_test_port("},{"line_number":126,"context_line":"            self.context, node_id\u003dself.node.id, address\u003d\u002752:54:00:cf:2d:01\u0027,"},{"line_number":127,"context_line":"            uuid\u003duuidutils.generate_uuid(), portgroup_id\u003dpg.id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a57fde8_2b95bde3","line":124,"updated":"2017-01-12 18:47:57.000000000","message":"i wondered why this was specified when it wasn\u0027t for the other tests. Looks like by default, obj_utils.create_test_portgroup() will set this to True. I suppose it is OK to explicitly put it here, but it is really due to the port with attached VIF that causes this portgroup to be ignored.\n\nI mean, you can set standalone_ports_supported\u003dTrue here but if you didn\u0027t have L128, this portgroup would have been picked, right?","commit_id":"2e15fa93737325978471838741c10d65782d8a51"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"5f940d81383ee95b6bd2d069d08b3b1a0164b22f","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        self.port.destroy()"},{"line_number":122,"context_line":"        pg \u003d obj_utils.create_test_portgroup("},{"line_number":123,"context_line":"            self.context, node_id\u003dself.node.id,"},{"line_number":124,"context_line":"            standalone_ports_supported\u003dTrue)"},{"line_number":125,"context_line":"        obj_utils.create_test_port("},{"line_number":126,"context_line":"            self.context, node_id\u003dself.node.id, address\u003d\u002752:54:00:cf:2d:01\u0027,"},{"line_number":127,"context_line":"            uuid\u003duuidutils.generate_uuid(), portgroup_id\u003dpg.id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"7a3c09a3_8b9f975e","line":124,"in_reply_to":"7a3c09a3_2826b716","updated":"2017-01-13 09:28:02.000000000","message":"Yes, your understanding is correct.","commit_id":"2e15fa93737325978471838741c10d65782d8a51"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"ec4b24737d06c0ec09e9de98cef978c7d948fad3","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        self.port.destroy()"},{"line_number":122,"context_line":"        pg \u003d obj_utils.create_test_portgroup("},{"line_number":123,"context_line":"            self.context, node_id\u003dself.node.id,"},{"line_number":124,"context_line":"            standalone_ports_supported\u003dTrue)"},{"line_number":125,"context_line":"        obj_utils.create_test_port("},{"line_number":126,"context_line":"            self.context, node_id\u003dself.node.id, address\u003d\u002752:54:00:cf:2d:01\u0027,"},{"line_number":127,"context_line":"            uuid\u003duuidutils.generate_uuid(), portgroup_id\u003dpg.id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a57fde8_1aabdd75","line":124,"in_reply_to":"9a57fde8_1a1bdd73","updated":"2017-01-12 20:12:21.000000000","message":"The test is what you describe.\n\nYes, this is confusing, but attach won\u0027t be attaching to a properly used portgroup, that has no vifs in ports inside it. The only way to set vif for port inside portgroup - is from api, to set its extra. Hence, setting extra.","commit_id":"2e15fa93737325978471838741c10d65782d8a51"},{"author":{"_account_id":13295,"name":"Mario Villaplana","email":"mario.villaplana@gmail.com","username":"mariojv"},"change_message_id":"c72443569cf5103f5690f3905254f8dfe5dbc371","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        self.port.destroy()"},{"line_number":122,"context_line":"        pg \u003d obj_utils.create_test_portgroup("},{"line_number":123,"context_line":"            self.context, node_id\u003dself.node.id,"},{"line_number":124,"context_line":"            standalone_ports_supported\u003dTrue)"},{"line_number":125,"context_line":"        obj_utils.create_test_port("},{"line_number":126,"context_line":"            self.context, node_id\u003dself.node.id, address\u003d\u002752:54:00:cf:2d:01\u0027,"},{"line_number":127,"context_line":"            uuid\u003duuidutils.generate_uuid(), portgroup_id\u003dpg.id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"7a3c09a3_2826b716","line":124,"in_reply_to":"9a57fde8_1aabdd75","updated":"2017-01-12 23:18:54.000000000","message":"Is it correct to assume that the reason this has to be \"extra\" is because as of this patch, a free portgroup always has precedence over its ports, so port.internal_info couldn\u0027t have a vif, because it\u0027d be in portgroup.internal_info (when using proper vif attach endpoint)? And that port would just get ignored if a second vif attach attempt occurred.\n\nJust checking my understanding. This seems logical, but it\u0027s a bit confusing","commit_id":"2e15fa93737325978471838741c10d65782d8a51"},{"author":{"_account_id":13295,"name":"Mario Villaplana","email":"mario.villaplana@gmail.com","username":"mariojv"},"change_message_id":"c72443569cf5103f5690f3905254f8dfe5dbc371","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        self.port.destroy()"},{"line_number":122,"context_line":"        pg \u003d obj_utils.create_test_portgroup("},{"line_number":123,"context_line":"            self.context, node_id\u003dself.node.id,"},{"line_number":124,"context_line":"            standalone_ports_supported\u003dTrue)"},{"line_number":125,"context_line":"        obj_utils.create_test_port("},{"line_number":126,"context_line":"            self.context, node_id\u003dself.node.id, address\u003d\u002752:54:00:cf:2d:01\u0027,"},{"line_number":127,"context_line":"            uuid\u003duuidutils.generate_uuid(), portgroup_id\u003dpg.id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"7a3c09a3_08465b23","line":124,"in_reply_to":"9a57fde8_1aabdd75","updated":"2017-01-12 23:18:54.000000000","message":"it should be extra because as of this patch, the vif will be set on the portgroup rather than the port, correct?","commit_id":"2e15fa93737325978471838741c10d65782d8a51"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"1782326b70e80da0bdc37215ceb011cfcd794a16","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        self.port.destroy()"},{"line_number":122,"context_line":"        pg \u003d obj_utils.create_test_portgroup("},{"line_number":123,"context_line":"            self.context, node_id\u003dself.node.id,"},{"line_number":124,"context_line":"            standalone_ports_supported\u003dTrue)"},{"line_number":125,"context_line":"        obj_utils.create_test_port("},{"line_number":126,"context_line":"            self.context, node_id\u003dself.node.id, address\u003d\u002752:54:00:cf:2d:01\u0027,"},{"line_number":127,"context_line":"            uuid\u003duuidutils.generate_uuid(), portgroup_id\u003dpg.id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a57fde8_51c1d0e3","line":124,"in_reply_to":"9a57fde8_2b95bde3","updated":"2017-01-12 19:18:31.000000000","message":"Well, yeah, this should be specified in all tests if the portgroup contains ports with vif attached. You should not be able to have a port with vif attached to it in portgroup, unless you have manually set extra/vif_port_id in this port (which will trigger port_changed function that ensures that portgroup this port belongs to has standalone_ports_supported)","commit_id":"2e15fa93737325978471838741c10d65782d8a51"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"37cbe3e75e1ce19f9c012b8a5902bec984eebea9","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        self.port.destroy()"},{"line_number":122,"context_line":"        pg \u003d obj_utils.create_test_portgroup("},{"line_number":123,"context_line":"            self.context, node_id\u003dself.node.id,"},{"line_number":124,"context_line":"            standalone_ports_supported\u003dTrue)"},{"line_number":125,"context_line":"        obj_utils.create_test_port("},{"line_number":126,"context_line":"            self.context, node_id\u003dself.node.id, address\u003d\u002752:54:00:cf:2d:01\u0027,"},{"line_number":127,"context_line":"            uuid\u003duuidutils.generate_uuid(), portgroup_id\u003dpg.id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a57fde8_1a1bdd73","line":124,"in_reply_to":"9a57fde8_511d5072","updated":"2017-01-12 20:02:55.000000000","message":"You lost me here; I don\u0027t see why it needs to be extra.\n\nI mean, really, the test is \u0027test_get_free_port_like_object_ignores_portgroup_with_attached_port()\u0027?","commit_id":"2e15fa93737325978471838741c10d65782d8a51"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"ad0a8174beac8f939d27b1b052cf03e745587000","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        self.port.destroy()"},{"line_number":122,"context_line":"        pg \u003d obj_utils.create_test_portgroup("},{"line_number":123,"context_line":"            self.context, node_id\u003dself.node.id,"},{"line_number":124,"context_line":"            standalone_ports_supported\u003dTrue)"},{"line_number":125,"context_line":"        obj_utils.create_test_port("},{"line_number":126,"context_line":"            self.context, node_id\u003dself.node.id, address\u003d\u002752:54:00:cf:2d:01\u0027,"},{"line_number":127,"context_line":"            uuid\u003duuidutils.generate_uuid(), portgroup_id\u003dpg.id,"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a57fde8_511d5072","line":124,"in_reply_to":"9a57fde8_51c1d0e3","updated":"2017-01-12 19:26:39.000000000","message":"I mean not \"standalone_ports_supported has to be specified\", but \"has to be true\". Oh, by the way it means that I should use extra instead of internal_info to match the actually possible scenario.","commit_id":"2e15fa93737325978471838741c10d65782d8a51"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"2dbfe0824edbbd6cf4789a1e8268bd8d450bd4e8","unresolved":false,"context_lines":[{"line_number":184,"context_line":"            self.assertRaises(exception.NoFreePhysicalPorts,"},{"line_number":185,"context_line":"                              common.get_free_port_like_object,"},{"line_number":186,"context_line":"                              task, self.vif_id)"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"class TestVifPortIDMixin(db_base.DbTestCase):"},{"line_number":190,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9a57fde8_6ef3530b","line":187,"updated":"2017-01-12 18:47:57.000000000","message":"These tests are fine but better (if anyone feels like it) is to separate them into three parts:\n1. tests _vif_attached()\n2. tests _get_free_portgroups_and_ports(), with mocked _vif_attached. The bulk of the tests could go here.\n3. tests get_free_port_like_object(), with mocked _get_free_portgroups_and_ports(). Then you could easily test that the port sorting works :)","commit_id":"2e15fa93737325978471838741c10d65782d8a51"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"c428d5d20e618fe388f5a05c21e2e4426373afb8","unresolved":false,"context_lines":[{"line_number":184,"context_line":"            self.assertRaises(exception.NoFreePhysicalPorts,"},{"line_number":185,"context_line":"                              common.get_free_port_like_object,"},{"line_number":186,"context_line":"                              task, self.vif_id)"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"class TestVifPortIDMixin(db_base.DbTestCase):"},{"line_number":190,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9a57fde8_74b6c28b","line":187,"in_reply_to":"9a57fde8_6ef3530b","updated":"2017-01-12 19:51:18.000000000","message":"Yeah, might be. OTOH these functions are not that complex, and better to reflect actual possible setup... But honestly, I don\u0027t really want to do this :) will update if someone feels more strongly about it.","commit_id":"2e15fa93737325978471838741c10d65782d8a51"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"2dbfe0824edbbd6cf4789a1e8268bd8d450bd4e8","unresolved":false,"context_lines":[{"line_number":681,"context_line":"        with task_manager.acquire(self.context, self.node.id) as task:"},{"line_number":682,"context_line":"            self.interface.portgroup_changed(task, pg)"},{"line_number":683,"context_line":"        self.assertFalse(mac_update_mock.call_count)"},{"line_number":684,"context_line":"        self.assertEqual(1, mock_warn.called)"},{"line_number":685,"context_line":""},{"line_number":686,"context_line":"    @mock.patch.object(common_utils, \u0027warn_about_deprecated_extra_vif_port_id\u0027,"},{"line_number":687,"context_line":"                       autospec\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a57fde8_34127f63","line":684,"updated":"2017-01-12 18:47:57.000000000","message":"i think if we want to know the number of times the warning was called, you want to do mock_warn.call_count. If you want to know if it was called (Boolean), then use .called. I don\u0027t like this because it seems to indicate that .called is an integer. If you want to know that it was called exactly once, you can also use .assert_called_once(). So many choices :)","commit_id":"2e15fa93737325978471838741c10d65782d8a51"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"1782326b70e80da0bdc37215ceb011cfcd794a16","unresolved":false,"context_lines":[{"line_number":681,"context_line":"        with task_manager.acquire(self.context, self.node.id) as task:"},{"line_number":682,"context_line":"            self.interface.portgroup_changed(task, pg)"},{"line_number":683,"context_line":"        self.assertFalse(mac_update_mock.call_count)"},{"line_number":684,"context_line":"        self.assertEqual(1, mock_warn.called)"},{"line_number":685,"context_line":""},{"line_number":686,"context_line":"    @mock.patch.object(common_utils, \u0027warn_about_deprecated_extra_vif_port_id\u0027,"},{"line_number":687,"context_line":"                       autospec\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a57fde8_518d5030","line":684,"in_reply_to":"9a57fde8_34127f63","updated":"2017-01-12 19:18:31.000000000","message":"hah right, it seems I\u0027ve swapped asserts on lines 683-684 :)","commit_id":"2e15fa93737325978471838741c10d65782d8a51"},{"author":{"_account_id":13295,"name":"Mario Villaplana","email":"mario.villaplana@gmail.com","username":"mariojv"},"change_message_id":"c72443569cf5103f5690f3905254f8dfe5dbc371","unresolved":false,"context_lines":[{"line_number":681,"context_line":"        with task_manager.acquire(self.context, self.node.id) as task:"},{"line_number":682,"context_line":"            self.interface.portgroup_changed(task, pg)"},{"line_number":683,"context_line":"        self.assertFalse(mac_update_mock.call_count)"},{"line_number":684,"context_line":"        self.assertEqual(1, mock_warn.called)"},{"line_number":685,"context_line":""},{"line_number":686,"context_line":"    @mock.patch.object(common_utils, \u0027warn_about_deprecated_extra_vif_port_id\u0027,"},{"line_number":687,"context_line":"                       autospec\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":17,"id":"7a3c09a3_bdbaebbe","line":684,"in_reply_to":"9a57fde8_518d5030","updated":"2017-01-12 23:18:54.000000000","message":"+1, asserts should be swapped. It passes though, so I\u0027m fine with it landing in a follow up patch","commit_id":"2e15fa93737325978471838741c10d65782d8a51"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"2dbfe0824edbbd6cf4789a1e8268bd8d450bd4e8","unresolved":false,"context_lines":[{"line_number":709,"context_line":"        with task_manager.acquire(self.context, self.node.id) as task:"},{"line_number":710,"context_line":"            self.interface.portgroup_changed(task, pg)"},{"line_number":711,"context_line":"        self.assertFalse(mac_update_mock.call_count)"},{"line_number":712,"context_line":"        self.assertEqual(0, mock_warn.called)"},{"line_number":713,"context_line":"        self.assertEqual(expected_extra, pg.extra)"},{"line_number":714,"context_line":""},{"line_number":715,"context_line":"    @mock.patch.object(neutron_common, \u0027update_port_address\u0027, autospec\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":17,"id":"9a57fde8_b4fcaf3f","line":712,"updated":"2017-01-12 18:47:57.000000000","message":"nit. The above two are checking that the mocks were not called, right? I think we tend to use self.assertFalse(mock*.called) for that, see L743. Which neither of these two are doing; I would have thought both would use the same pattern, whatever that might be :)\n\nI see this is being done in the above tests too, from L664.","commit_id":"2e15fa93737325978471838741c10d65782d8a51"}],"releasenotes/notes/allow-attach-vif-to-portgroup-ce24b72632ec5772.yaml":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8b489d3b5844c3320f7a3cb37d7c25d8e0bfac17","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - Enable port group usage when attaching/detaching VIFs."},{"line_number":4,"context_line":"    Port groups are picked with higher preference than"},{"line_number":5,"context_line":"    ports in attach/detach VIF logic. It allows to utilize"},{"line_number":6,"context_line":"    node port groups before starting attach VIF to a ports."}],"source_content_type":"text/x-yaml","patch_set":7,"id":"da4df55a_9d125461","line":3,"updated":"2016-12-22 23:04:57.000000000","message":"s/Enable/Enables/","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"9abffc00afc80806775470eb7fe7456034f4b3ab","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - Enable port group usage when attaching/detaching VIFs."},{"line_number":4,"context_line":"    Port groups are picked with higher preference than"},{"line_number":5,"context_line":"    ports in attach/detach VIF logic. It allows to utilize"},{"line_number":6,"context_line":"    node port groups before starting attach VIF to a ports."}],"source_content_type":"text/x-yaml","patch_set":7,"id":"da4df55a_70074e18","line":3,"in_reply_to":"da4df55a_9d125461","updated":"2016-12-26 12:48:11.000000000","message":"Done","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"8b489d3b5844c3320f7a3cb37d7c25d8e0bfac17","unresolved":false,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - Enable port group usage when attaching/detaching VIFs."},{"line_number":4,"context_line":"    Port groups are picked with higher preference than"},{"line_number":5,"context_line":"    ports in attach/detach VIF logic. It allows to utilize"},{"line_number":6,"context_line":"    node port groups before starting attach VIF to a ports."}],"source_content_type":"text/x-yaml","patch_set":7,"id":"da4df55a_b82566ac","line":5,"updated":"2016-12-22 23:04:57.000000000","message":"well, not for detach.\n\nHow about \u0027When attaching a VIF to a node, it is attached to the first free port group. If there are no free port groups, the first available port (pxe_enabled has higher priority) is used instead.\n\nAre we also deprecating portgroup.extra[\u0027vif_port_id\u0027]","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"9abffc00afc80806775470eb7fe7456034f4b3ab","unresolved":false,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - Enable port group usage when attaching/detaching VIFs."},{"line_number":4,"context_line":"    Port groups are picked with higher preference than"},{"line_number":5,"context_line":"    ports in attach/detach VIF logic. It allows to utilize"},{"line_number":6,"context_line":"    node port groups before starting attach VIF to a ports."}],"source_content_type":"text/x-yaml","patch_set":7,"id":"da4df55a_b0153641","line":5,"in_reply_to":"da4df55a_b82566ac","updated":"2016-12-26 12:48:11.000000000","message":"Done","commit_id":"551c373f192da2e0b2754b9617f7297814b88e60"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"c2670dd47e282f024cda1793515d6d60000e10f2","unresolved":false,"context_lines":[{"line_number":6,"context_line":"    (pxe_enabled has higher priority) is used instead."},{"line_number":7,"context_line":"deprecations:"},{"line_number":8,"context_line":"  - Using portgroup.extra[\u0027vif_port_id\u0027] for attaching/detaching"},{"line_number":9,"context_line":"    VIFs to portgroups is deprecated and will be removed in Pike release."}],"source_content_type":"text/x-yaml","patch_set":8,"id":"ba5201f7_14962294","line":9,"updated":"2017-01-10 19:38:09.000000000","message":"nit s/portgroups/port groups/","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"c58edcb89d8358dc06cf1388ca4465a7594c30b3","unresolved":false,"context_lines":[{"line_number":6,"context_line":"    (pxe_enabled has higher priority) is used instead."},{"line_number":7,"context_line":"deprecations:"},{"line_number":8,"context_line":"  - Using portgroup.extra[\u0027vif_port_id\u0027] for attaching/detaching"},{"line_number":9,"context_line":"    VIFs to portgroups is deprecated and will be removed in Pike release."}],"source_content_type":"text/x-yaml","patch_set":8,"id":"ba5201f7_36ba32e2","line":9,"in_reply_to":"ba5201f7_14962294","updated":"2017-01-11 10:13:29.000000000","message":"Done","commit_id":"384dfb86a821ed029d5d26c36b79a34bade37482"},{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"e17c413485de554ee72918d21cafe356540a6e7d","unresolved":false,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - Enables port group usage when attaching/detaching VIFs."},{"line_number":4,"context_line":"    When attaching a VIF to a node, it is attached to the first free port"},{"line_number":5,"context_line":"    group. If there are no free port groups, the first available port"},{"line_number":6,"context_line":"    (pxe_enabled has higher priority) is used instead."},{"line_number":7,"context_line":"deprecations:"},{"line_number":8,"context_line":"  - Using portgroup.extra[\u0027vif_port_id\u0027] for attaching/detaching"}],"source_content_type":"text/x-yaml","patch_set":15,"id":"9a57fde8_963418df","line":5,"updated":"2017-01-12 15:32:28.000000000","message":"seems we should mention that if at least one port in portgroup has vif attached, we will not pick this portgroup.","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"11993f43e53303f170c587b352866ff7a30c50fe","unresolved":false,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - Enables port group usage when attaching/detaching VIFs."},{"line_number":4,"context_line":"    When attaching a VIF to a node, it is attached to the first free port"},{"line_number":5,"context_line":"    group. If there are no free port groups, the first available port"},{"line_number":6,"context_line":"    (pxe_enabled has higher priority) is used instead."},{"line_number":7,"context_line":"deprecations:"},{"line_number":8,"context_line":"  - Using portgroup.extra[\u0027vif_port_id\u0027] for attaching/detaching"}],"source_content_type":"text/x-yaml","patch_set":15,"id":"9a57fde8_b6559c1e","line":5,"in_reply_to":"9a57fde8_963418df","updated":"2017-01-12 15:48:43.000000000","message":"Done","commit_id":"96728e55695a0a126c5d258c1230c26d1abb6e6a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"928d89713d55a820ce742b1d6a453b2b5c8274a4","unresolved":false,"context_lines":[{"line_number":3,"context_line":"  - Enables port group usage when attaching/detaching VIFs."},{"line_number":4,"context_line":"    When attaching a VIF to a node, it is attached to the first free port"},{"line_number":5,"context_line":"    group (that has no VIFs attached to any of its ports, otherwise its ports"},{"line_number":6,"context_line":"    are considered as available for attachment too). If there are no free port"},{"line_number":7,"context_line":"    groups, the first available port (pxe_enabled has higher priority) is used"},{"line_number":8,"context_line":"    instead."},{"line_number":9,"context_line":"deprecations:"}],"source_content_type":"text/x-yaml","patch_set":16,"id":"9a57fde8_a05b9153","line":6,"updated":"2017-01-12 16:49:30.000000000","message":"hmm. Maybe \u0027.. its ports. Otherwise, only the unattached ports of this portgroup are available for attachment.","commit_id":"39c53fb6a42ab9a319252a3cb9e7a5e6166203a8"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"776b1e41a95fc4f5bc7e8cd778ac41f1e2102c97","unresolved":false,"context_lines":[{"line_number":3,"context_line":"  - Enables port group usage when attaching/detaching VIFs."},{"line_number":4,"context_line":"    When attaching a VIF to a node, it is attached to the first free port"},{"line_number":5,"context_line":"    group (that has no VIFs attached to any of its ports, otherwise its ports"},{"line_number":6,"context_line":"    are considered as available for attachment too). If there are no free port"},{"line_number":7,"context_line":"    groups, the first available port (pxe_enabled has higher priority) is used"},{"line_number":8,"context_line":"    instead."},{"line_number":9,"context_line":"deprecations:"}],"source_content_type":"text/x-yaml","patch_set":16,"id":"9a57fde8_59257ca9","line":6,"in_reply_to":"9a57fde8_a05b9153","updated":"2017-01-12 17:16:01.000000000","message":"Done","commit_id":"39c53fb6a42ab9a319252a3cb9e7a5e6166203a8"}]}
