)]}'
{"kuryr_kubernetes/controller/drivers/vif_pool.py":[{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"ccbe18774bb0078e14c1282f56086b693065f445","unresolved":false,"context_lines":[{"line_number":418,"context_line":"    def _cleanup_leftover_ports(self):"},{"line_number":419,"context_line":"        os_net \u003d clients.get_network_client()"},{"line_number":420,"context_line":"        attrs \u003d {\u0027device_owner\u0027: kl_const.DEVICE_OWNER, \u0027status\u0027: \u0027DOWN\u0027}"},{"line_number":421,"context_line":"        existing_ports \u003d c_utils.get_ports_by_attrs(**attrs)"},{"line_number":422,"context_line":""},{"line_number":423,"context_line":"        tags \u003d config.CONF.neutron_defaults.resource_tags"},{"line_number":424,"context_line":"        if tags:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_f3e25730","line":421,"range":{"start_line":421,"start_character":0,"end_line":421,"end_character":60},"updated":"2019-12-02 14:04:55.000000000","message":"This method should also be updated to use openstackSDK, otherwise ports will still be a dict and line 443 will fail.","commit_id":"98e6f3a4ed3e0a57217bdb7c50deb0b99c8f2b99"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"0b49347871bb50e706e6fa22ef7392cf251b2183","unresolved":false,"context_lines":[{"line_number":418,"context_line":"    def _cleanup_leftover_ports(self):"},{"line_number":419,"context_line":"        os_net \u003d clients.get_network_client()"},{"line_number":420,"context_line":"        attrs \u003d {\u0027device_owner\u0027: kl_const.DEVICE_OWNER, \u0027status\u0027: \u0027DOWN\u0027}"},{"line_number":421,"context_line":"        existing_ports \u003d c_utils.get_ports_by_attrs(**attrs)"},{"line_number":422,"context_line":""},{"line_number":423,"context_line":"        tags \u003d config.CONF.neutron_defaults.resource_tags"},{"line_number":424,"context_line":"        if tags:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_4975be32","line":421,"range":{"start_line":421,"start_character":0,"end_line":421,"end_character":60},"in_reply_to":"3fa7e38b_f3e25730","updated":"2019-12-02 15:49:41.000000000","message":"This method will be removed in subsequent commit, I\u0027ll change back accessing for keys in case of existing ports.","commit_id":"98e6f3a4ed3e0a57217bdb7c50deb0b99c8f2b99"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"9ed24e93d71fb0eb31d04a8728113fdcd6936d17","unresolved":false,"context_lines":[{"line_number":440,"context_line":"                                # of successfully deleted port we want to"},{"line_number":441,"context_line":"                                # break the loop."},{"line_number":442,"context_line":"                                try:"},{"line_number":443,"context_line":"                                    os_net.delete_port(port[\u0027id\u0027])"},{"line_number":444,"context_line":"                                except os_exc.SDKException:"},{"line_number":445,"context_line":"                                    LOG.debug(\"Problem deleting leftover port \""},{"line_number":446,"context_line":"                                              \"%s. Skipping.\", port[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_aef20204","line":443,"range":{"start_line":443,"start_character":36,"end_line":443,"end_character":66},"updated":"2019-12-05 08:36:42.000000000","message":"Why not keep the break here and remove the TODO?","commit_id":"1f20789f6170c7eefe621c598f8d79bbf338b3be"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"eadedf143dfc48ed6d7ad9180a836bf67faaa20a","unresolved":false,"context_lines":[{"line_number":440,"context_line":"                                # of successfully deleted port we want to"},{"line_number":441,"context_line":"                                # break the loop."},{"line_number":442,"context_line":"                                try:"},{"line_number":443,"context_line":"                                    os_net.delete_port(port[\u0027id\u0027])"},{"line_number":444,"context_line":"                                except os_exc.SDKException:"},{"line_number":445,"context_line":"                                    LOG.debug(\"Problem deleting leftover port \""},{"line_number":446,"context_line":"                                              \"%s. Skipping.\", port[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_6bf3f9e9","line":443,"range":{"start_line":443,"start_character":36,"end_line":443,"end_character":66},"in_reply_to":"3fa7e38b_6bf22308","updated":"2019-12-17 08:00:30.000000000","message":"exactly. Only if any of the tags are not included.\n\nBtw, I got confused by the difference function. I expected it to return the differences between both sets, instead of just the items present in tags and not in ports. If it works this way, then it should work, yes!","commit_id":"1f20789f6170c7eefe621c598f8d79bbf338b3be"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"658d9a816d0a64b4c1f6dde8888619c194053568","unresolved":false,"context_lines":[{"line_number":440,"context_line":"                                # of successfully deleted port we want to"},{"line_number":441,"context_line":"                                # break the loop."},{"line_number":442,"context_line":"                                try:"},{"line_number":443,"context_line":"                                    os_net.delete_port(port[\u0027id\u0027])"},{"line_number":444,"context_line":"                                except os_exc.SDKException:"},{"line_number":445,"context_line":"                                    LOG.debug(\"Problem deleting leftover port \""},{"line_number":446,"context_line":"                                              \"%s. Skipping.\", port[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_aed7bf22","line":443,"range":{"start_line":443,"start_character":36,"end_line":443,"end_character":66},"in_reply_to":"3fa7e38b_6bf3f9e9","updated":"2019-12-17 09:29:41.000000000","message":"Ack :)","commit_id":"1f20789f6170c7eefe621c598f8d79bbf338b3be"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"f25efe81e484ecbadfa1985070ceb92ccc1e5597","unresolved":false,"context_lines":[{"line_number":440,"context_line":"                                # of successfully deleted port we want to"},{"line_number":441,"context_line":"                                # break the loop."},{"line_number":442,"context_line":"                                try:"},{"line_number":443,"context_line":"                                    os_net.delete_port(port[\u0027id\u0027])"},{"line_number":444,"context_line":"                                except os_exc.SDKException:"},{"line_number":445,"context_line":"                                    LOG.debug(\"Problem deleting leftover port \""},{"line_number":446,"context_line":"                                              \"%s. Skipping.\", port[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_ba706e0b","line":443,"range":{"start_line":443,"start_character":36,"end_line":443,"end_character":66},"in_reply_to":"3fa7e38b_97e076cd","updated":"2019-12-16 08:40:35.000000000","message":"Not sure I understand. Here we are iterating on the tags of the port. So it is looping on the tags for the same port. The break should still be ok as we are deleting \u0027always\u0027 the same port. We just need to decide on deleting it or not depending on its tag, right?","commit_id":"1f20789f6170c7eefe621c598f8d79bbf338b3be"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"cc17849807cd2d69b8b64e2a8dd998f9dc305dea","unresolved":false,"context_lines":[{"line_number":440,"context_line":"                                # of successfully deleted port we want to"},{"line_number":441,"context_line":"                                # break the loop."},{"line_number":442,"context_line":"                                try:"},{"line_number":443,"context_line":"                                    os_net.delete_port(port[\u0027id\u0027])"},{"line_number":444,"context_line":"                                except os_exc.SDKException:"},{"line_number":445,"context_line":"                                    LOG.debug(\"Problem deleting leftover port \""},{"line_number":446,"context_line":"                                              \"%s. Skipping.\", port[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_6bf22308","line":443,"range":{"start_line":443,"start_character":36,"end_line":443,"end_character":66},"in_reply_to":"3fa7e38b_a5b7ead7","updated":"2019-12-16 16:49:18.000000000","message":"It will work as expected. We take the resource_tags, as the \"pattern\", and trying to match it to the corresponding set from port.tags collection. Even if port.tags have some extra items, that doesn\u0027t hurt us:\n\n    \u003e\u003e\u003e tags \u003d set([\u0027a\u0027, \u0027b\u0027, \u0027c\u0027])\n    \u003e\u003e\u003e port1_tags \u003d set([\u0027a\u0027, \u0027d\u0027])\n    \u003e\u003e\u003e port2_tags \u003d set([\u0027d\u0027, \u0027e\u0027])\n    \u003e\u003e\u003e port3_tags \u003d set([])\n    \u003e\u003e\u003e port4_tags \u003d set([\u0027a\u0027, \u0027b\u0027, \u0027c\u0027, \u0027d\u0027])\n    \u003e\u003e\u003e for p in (port1_tags, port2_tags, port3_tags, port4_tags):\n    ...     print(tags.difference(p))\n    ... \n    {\u0027b\u0027, \u0027c\u0027}\n    {\u0027a\u0027, \u0027b\u0027, \u0027c\u0027}\n    {\u0027a\u0027, \u0027b\u0027, \u0027c\u0027}\n    set()\n\nLet\u0027s clarify than. We remove the port ONLY if it doesn\u0027t have ALL the tags defined in resource_tags config option, right?","commit_id":"1f20789f6170c7eefe621c598f8d79bbf338b3be"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"06f6a80ccd859d7e81e8145d3f7485e1dc13c7d8","unresolved":false,"context_lines":[{"line_number":440,"context_line":"                                # of successfully deleted port we want to"},{"line_number":441,"context_line":"                                # break the loop."},{"line_number":442,"context_line":"                                try:"},{"line_number":443,"context_line":"                                    os_net.delete_port(port[\u0027id\u0027])"},{"line_number":444,"context_line":"                                except os_exc.SDKException:"},{"line_number":445,"context_line":"                                    LOG.debug(\"Problem deleting leftover port \""},{"line_number":446,"context_line":"                                              \"%s. Skipping.\", port[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_97e076cd","line":443,"range":{"start_line":443,"start_character":36,"end_line":443,"end_character":66},"in_reply_to":"3fa7e38b_aef20204","updated":"2019-12-05 11:45:18.000000000","message":"Because, it\u0027s different situation we have here.\n\nIn case of neutron client, if we try to remove nonexistsent port, there will be PortNotFoundClient exception thrown, so that we continue the loop (because of line 443, where we catch NeutronClientException, which is a base class for all neutron client exceptions).\n\nIn case of openstacksdk, there will be nothing. no result, no exception, for nonexistent port. So we cannot say if it succeed or not. By breaking the loop based on assumption, that it was deleted is a false positive, and we don\u0027t have certainty that proper port from existing_ports collection was deleted or not.","commit_id":"1f20789f6170c7eefe621c598f8d79bbf338b3be"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"6b9efd5e8ba02e07c1aa0fc9bd27c7949e74d85b","unresolved":false,"context_lines":[{"line_number":440,"context_line":"                                # of successfully deleted port we want to"},{"line_number":441,"context_line":"                                # break the loop."},{"line_number":442,"context_line":"                                try:"},{"line_number":443,"context_line":"                                    os_net.delete_port(port[\u0027id\u0027])"},{"line_number":444,"context_line":"                                except os_exc.SDKException:"},{"line_number":445,"context_line":"                                    LOG.debug(\"Problem deleting leftover port \""},{"line_number":446,"context_line":"                                              \"%s. Skipping.\", port[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_f08285a6","line":443,"range":{"start_line":443,"start_character":36,"end_line":443,"end_character":66},"in_reply_to":"3fa7e38b_ba706e0b","updated":"2019-12-16 10:36:55.000000000","message":"Well, yes. So maybe we could rearrange this code a bit, so that in case of match for tag in port object we could fire and forget, i.e.:\n\n   if set(tags).intersection(set(port.get(tags, [])):\n       try:\n           os_net.delete_port(port[\u0027id\u0027])\n       ...\n\nso that we don\u0027t need to iterate over the tags collection at all. What do you think?","commit_id":"1f20789f6170c7eefe621c598f8d79bbf338b3be"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"e01c39e6b503ce160ddcbd1f1e79a892d3156522","unresolved":false,"context_lines":[{"line_number":440,"context_line":"                                # of successfully deleted port we want to"},{"line_number":441,"context_line":"                                # break the loop."},{"line_number":442,"context_line":"                                try:"},{"line_number":443,"context_line":"                                    os_net.delete_port(port[\u0027id\u0027])"},{"line_number":444,"context_line":"                                except os_exc.SDKException:"},{"line_number":445,"context_line":"                                    LOG.debug(\"Problem deleting leftover port \""},{"line_number":446,"context_line":"                                              \"%s. Skipping.\", port[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_a5b7ead7","line":443,"range":{"start_line":443,"start_character":36,"end_line":443,"end_character":66},"in_reply_to":"3fa7e38b_bc7867f7","updated":"2019-12-16 15:32:31.000000000","message":"not sure this last one would work. The port can have some extra tags and that should still be ok. What we need to ensure is that, all the tags (config.CONF.neutron_defaults.resource_tags) are in the ports tags. And if not, delete it.","commit_id":"1f20789f6170c7eefe621c598f8d79bbf338b3be"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"e584978e38bec7d455559749b862898e4d0f7ba3","unresolved":false,"context_lines":[{"line_number":440,"context_line":"                                # of successfully deleted port we want to"},{"line_number":441,"context_line":"                                # break the loop."},{"line_number":442,"context_line":"                                try:"},{"line_number":443,"context_line":"                                    os_net.delete_port(port[\u0027id\u0027])"},{"line_number":444,"context_line":"                                except os_exc.SDKException:"},{"line_number":445,"context_line":"                                    LOG.debug(\"Problem deleting leftover port \""},{"line_number":446,"context_line":"                                              \"%s. Skipping.\", port[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_bc7867f7","line":443,"range":{"start_line":443,"start_character":36,"end_line":443,"end_character":66},"in_reply_to":"3fa7e38b_f08285a6","updated":"2019-12-16 13:21:08.000000000","message":"or even:\n\n                    if port.get(\u0027binding:host_id\u0027):\n                        if set(tags).difference(set(port.get(\u0027tags\u0027, ))):\n                            try:\n                                os_net.delete_port(port[\u0027id\u0027])\n                            except …","commit_id":"1f20789f6170c7eefe621c598f8d79bbf338b3be"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"51028aaf6caa37912c023a43ac392d67d8814268","unresolved":false,"context_lines":[{"line_number":313,"context_line":"                del self._available_ports_pools[pool_key][sg_key]"},{"line_number":314,"context_line":"                for port_id in ports:"},{"line_number":315,"context_line":"                    # remove all SGs from the port to be reused"},{"line_number":316,"context_line":"                    os_net.update_port(port_id, security_groups\u003dNone)"},{"line_number":317,"context_line":"                    # add the port to the default pool"},{"line_number":318,"context_line":"                    self._available_ports_pools[pool_key].setdefault("},{"line_number":319,"context_line":"                        tuple([]), []).append(port_id)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_0f283b31","line":316,"range":{"start_line":316,"start_character":64,"end_line":316,"end_character":68},"updated":"2019-12-18 11:53:26.000000000","message":"I tested this will work and clear the SG\u0027s, but I\u0027d rather be explicit here and specify an empty list as it seems to work too.\n\nOr is there some openstacksdk specific forcing use of None?","commit_id":"60f2fc6f6e1a4cbb77d85bcd28822fc9fed47ab7"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"1256937003f1c3320670f1a5aebd16a86094027a","unresolved":false,"context_lines":[{"line_number":313,"context_line":"                del self._available_ports_pools[pool_key][sg_key]"},{"line_number":314,"context_line":"                for port_id in ports:"},{"line_number":315,"context_line":"                    # remove all SGs from the port to be reused"},{"line_number":316,"context_line":"                    os_net.update_port(port_id, security_groups\u003dNone)"},{"line_number":317,"context_line":"                    # add the port to the default pool"},{"line_number":318,"context_line":"                    self._available_ports_pools[pool_key].setdefault("},{"line_number":319,"context_line":"                        tuple([]), []).append(port_id)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_9858daf9","line":316,"range":{"start_line":316,"start_character":64,"end_line":316,"end_character":68},"in_reply_to":"3fa7e38b_0f283b31","updated":"2019-12-19 14:10:44.000000000","message":"It\u0027s not:\n\n\u003e     #: The IDs of any attached security groups.\n\u003e     #: *Type: list of strs of the security group IDs*\n\u003e     security_group_ids \u003d resource.Body(\u0027security_groups\u0027, type\u003dlist)\n\nthat\u0027s how this field is defend in Port module. Although as apuimedo point out the other day, in https://github.com/openstack/openstacksdk/blob/bf6651f149df8e607a9152c5eeb279164b3a7f8e/openstack/cloud/_network.py#L2441-L2442 there is the statement, that we should use None for clear out the content of the list. I know, that this module is a part of cloud portion of the opnestacksdk, but still.\n\nOTOH, empty list or None sounds the same for me in this case, so it\u0027s your call, which you want to prefer.\n\nAlso, as the port have defined explicitly security_groups as security_groups_ids, we also should use it here.","commit_id":"60f2fc6f6e1a4cbb77d85bcd28822fc9fed47ab7"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"51028aaf6caa37912c023a43ac392d67d8814268","unresolved":false,"context_lines":[{"line_number":680,"context_line":"        if config.CONF.neutron_defaults.resource_tags:"},{"line_number":681,"context_line":"            args[\u0027tags\u0027] \u003d config.CONF.neutron_defaults.resource_tags"},{"line_number":682,"context_line":""},{"line_number":683,"context_line":"        trunks \u003d os_net.get_trunks(args)"},{"line_number":684,"context_line":""},{"line_number":685,"context_line":"        for trunk in trunks:"},{"line_number":686,"context_line":"            for sp in trunk.sub_ports:"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_af67a752","line":683,"range":{"start_line":683,"start_character":24,"end_line":683,"end_character":34},"updated":"2019-12-18 11:53:26.000000000","message":"I think it\u0027s just trunks() [1].\n\n[1] https://github.com/openstack/openstacksdk/blob/28fcf6e313f431ffd411f7ef4cb73bdcb3e70484/openstack/network/v2/_proxy.py#L3660-L3669","commit_id":"60f2fc6f6e1a4cbb77d85bcd28822fc9fed47ab7"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"1256937003f1c3320670f1a5aebd16a86094027a","unresolved":false,"context_lines":[{"line_number":680,"context_line":"        if config.CONF.neutron_defaults.resource_tags:"},{"line_number":681,"context_line":"            args[\u0027tags\u0027] \u003d config.CONF.neutron_defaults.resource_tags"},{"line_number":682,"context_line":""},{"line_number":683,"context_line":"        trunks \u003d os_net.get_trunks(args)"},{"line_number":684,"context_line":""},{"line_number":685,"context_line":"        for trunk in trunks:"},{"line_number":686,"context_line":"            for sp in trunk.sub_ports:"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_3820c6b1","line":683,"range":{"start_line":683,"start_character":24,"end_line":683,"end_character":34},"in_reply_to":"3fa7e38b_af67a752","updated":"2019-12-19 14:10:44.000000000","message":"Well, yeah, you probably right ;), but with one quirk - we cannot filter trunks by tags using the version of openstacksdk we are pinned to, that\u0027s why I needed to provide this workaround. But now I realized, that it is in other, sub sequential commit, so that I need to move it before this one.","commit_id":"60f2fc6f6e1a4cbb77d85bcd28822fc9fed47ab7"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"51028aaf6caa37912c023a43ac392d67d8814268","unresolved":false,"context_lines":[{"line_number":829,"context_line":"    def _get_trunk_id(self, os_net, pool_key):"},{"line_number":830,"context_line":"        trunk_id \u003d self._known_trunk_ids.get(pool_key, None)"},{"line_number":831,"context_line":"        if not trunk_id:"},{"line_number":832,"context_line":"            p_port \u003d self._drv_vif._get_parent_port_by_host_ip(os_net,"},{"line_number":833,"context_line":"                                                               pool_key[0])"},{"line_number":834,"context_line":"            trunk_id \u003d self._drv_vif._get_trunk_id(p_port)"},{"line_number":835,"context_line":"            self._known_trunk_ids[pool_key] \u003d trunk_id"},{"line_number":836,"context_line":"        return trunk_id"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_af500761","line":833,"range":{"start_line":832,"start_character":0,"end_line":833,"end_character":75},"updated":"2019-12-18 11:53:26.000000000","message":"Is this method changed yet? Seems like it isn\u0027t to me.","commit_id":"60f2fc6f6e1a4cbb77d85bcd28822fc9fed47ab7"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"1256937003f1c3320670f1a5aebd16a86094027a","unresolved":false,"context_lines":[{"line_number":829,"context_line":"    def _get_trunk_id(self, os_net, pool_key):"},{"line_number":830,"context_line":"        trunk_id \u003d self._known_trunk_ids.get(pool_key, None)"},{"line_number":831,"context_line":"        if not trunk_id:"},{"line_number":832,"context_line":"            p_port \u003d self._drv_vif._get_parent_port_by_host_ip(os_net,"},{"line_number":833,"context_line":"                                                               pool_key[0])"},{"line_number":834,"context_line":"            trunk_id \u003d self._drv_vif._get_trunk_id(p_port)"},{"line_number":835,"context_line":"            self._known_trunk_ids[pool_key] \u003d trunk_id"},{"line_number":836,"context_line":"        return trunk_id"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_780f1e39","line":833,"range":{"start_line":832,"start_character":0,"end_line":833,"end_character":75},"in_reply_to":"3fa7e38b_af500761","updated":"2019-12-19 14:10:44.000000000","message":"Done","commit_id":"60f2fc6f6e1a4cbb77d85bcd28822fc9fed47ab7"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"51028aaf6caa37912c023a43ac392d67d8814268","unresolved":false,"context_lines":[{"line_number":1005,"context_line":"            ports_id \u003d [p_id for sg_ports in ports.values()"},{"line_number":1006,"context_line":"                        for p_id in sg_ports]"},{"line_number":1007,"context_line":"            try:"},{"line_number":1008,"context_line":"                self._drv_vif._remove_subports(os_net, trunk_id, ports_id)"},{"line_number":1009,"context_line":"            except os_exc.SDKException:"},{"line_number":1010,"context_line":"                LOG.exception(\u0027Error removing subports from trunk: %s\u0027,"},{"line_number":1011,"context_line":"                              trunk_id)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_8fdc2be2","line":1008,"range":{"start_line":1008,"start_character":0,"end_line":1008,"end_character":74},"updated":"2019-12-18 11:53:26.000000000","message":"This method is not yet switched to use os_net too.","commit_id":"60f2fc6f6e1a4cbb77d85bcd28822fc9fed47ab7"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"1256937003f1c3320670f1a5aebd16a86094027a","unresolved":false,"context_lines":[{"line_number":1005,"context_line":"            ports_id \u003d [p_id for sg_ports in ports.values()"},{"line_number":1006,"context_line":"                        for p_id in sg_ports]"},{"line_number":1007,"context_line":"            try:"},{"line_number":1008,"context_line":"                self._drv_vif._remove_subports(os_net, trunk_id, ports_id)"},{"line_number":1009,"context_line":"            except os_exc.SDKException:"},{"line_number":1010,"context_line":"                LOG.exception(\u0027Error removing subports from trunk: %s\u0027,"},{"line_number":1011,"context_line":"                              trunk_id)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3fa7e38b_3809a631","line":1008,"range":{"start_line":1008,"start_character":0,"end_line":1008,"end_character":74},"in_reply_to":"3fa7e38b_8fdc2be2","updated":"2019-12-19 14:10:44.000000000","message":"Done","commit_id":"60f2fc6f6e1a4cbb77d85bcd28822fc9fed47ab7"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"51028aaf6caa37912c023a43ac392d67d8814268","unresolved":false,"context_lines":[{"line_number":829,"context_line":"    def _get_trunk_id(self, os_net, pool_key):"},{"line_number":830,"context_line":"        trunk_id \u003d self._known_trunk_ids.get(pool_key, None)"},{"line_number":831,"context_line":"        if not trunk_id:"},{"line_number":832,"context_line":"            p_port \u003d self._drv_vif._get_parent_port_by_host_ip(os_net,"},{"line_number":833,"context_line":"                                                               pool_key[0])"},{"line_number":834,"context_line":"            trunk_id \u003d self._drv_vif._get_trunk_id(p_port)"},{"line_number":835,"context_line":"            self._known_trunk_ids[pool_key] \u003d trunk_id"},{"line_number":836,"context_line":"        return trunk_id"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_af8327aa","line":833,"range":{"start_line":832,"start_character":0,"end_line":833,"end_character":75},"updated":"2019-12-18 11:53:26.000000000","message":"This is still not ready to use os_net.","commit_id":"daa27900ddcfd9188f7e54edc28a605bd8a6dd86"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"51028aaf6caa37912c023a43ac392d67d8814268","unresolved":false,"context_lines":[{"line_number":918,"context_line":""},{"line_number":919,"context_line":"                    elif action \u003d\u003d \u0027free\u0027:"},{"line_number":920,"context_line":"                        try:"},{"line_number":921,"context_line":"                            self._drv_vif._remove_subport(os_net, trunk_id,"},{"line_number":922,"context_line":"                                                          kuryr_subport[\u0027id\u0027])"},{"line_number":923,"context_line":"                            os_net.delete_port(kuryr_subport[\u0027id\u0027])"},{"line_number":924,"context_line":"                            self._drv_vif._release_vlan_id("},{"line_number":925,"context_line":"                                subport[\u0027segmentation_id\u0027])"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_ef991f1e","line":922,"range":{"start_line":921,"start_character":0,"end_line":922,"end_character":78},"updated":"2019-12-18 11:53:26.000000000","message":"Not yet switched.","commit_id":"daa27900ddcfd9188f7e54edc28a605bd8a6dd86"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"51028aaf6caa37912c023a43ac392d67d8814268","unresolved":false,"context_lines":[{"line_number":1005,"context_line":"            ports_id \u003d [p_id for sg_ports in ports.values()"},{"line_number":1006,"context_line":"                        for p_id in sg_ports]"},{"line_number":1007,"context_line":"            try:"},{"line_number":1008,"context_line":"                self._drv_vif._remove_subports(os_net, trunk_id, ports_id)"},{"line_number":1009,"context_line":"            except os_exc.SDKException:"},{"line_number":1010,"context_line":"                LOG.exception(\u0027Error removing subports from trunk: %s\u0027,"},{"line_number":1011,"context_line":"                              trunk_id)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3fa7e38b_cffb0346","line":1008,"range":{"start_line":1008,"start_character":0,"end_line":1008,"end_character":74},"updated":"2019-12-18 11:53:26.000000000","message":"This method is not yet ready to use os_net.","commit_id":"daa27900ddcfd9188f7e54edc28a605bd8a6dd86"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"6b71124b7c907754b714831381182c8845e9635f","unresolved":false,"context_lines":[{"line_number":303,"context_line":""},{"line_number":304,"context_line":"    def remove_sg_from_pools(self, sg_id, net_id):"},{"line_number":305,"context_line":"        os_net \u003d clients.get_network_client()"},{"line_number":306,"context_line":"        for pool_key, pool_ports in self._available_ports_pools.items():"},{"line_number":307,"context_line":"            if self._get_pool_key_net(pool_key) !\u003d net_id:"},{"line_number":308,"context_line":"                continue"},{"line_number":309,"context_line":"            for sg_key, ports in pool_ports.items():"},{"line_number":310,"context_line":"                if sg_id not in sg_key:"},{"line_number":311,"context_line":"                    continue"},{"line_number":312,"context_line":"                # remove the pool associated to that SG"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_5f79be2d","line":309,"range":{"start_line":306,"start_character":0,"end_line":309,"end_character":52},"updated":"2019-12-24 10:56:49.000000000","message":"Got this error here: http://paste.openstack.org/show/787891/\n\nShould not be related, but I did not hit it until testing with this","commit_id":"dcd698593e8448a49170b48a811a4abf61cfaf3e"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"b6ed7381134b518942dc3c0afedd21e296b6746c","unresolved":false,"context_lines":[{"line_number":303,"context_line":""},{"line_number":304,"context_line":"    def remove_sg_from_pools(self, sg_id, net_id):"},{"line_number":305,"context_line":"        os_net \u003d clients.get_network_client()"},{"line_number":306,"context_line":"        for pool_key, pool_ports in self._available_ports_pools.items():"},{"line_number":307,"context_line":"            if self._get_pool_key_net(pool_key) !\u003d net_id:"},{"line_number":308,"context_line":"                continue"},{"line_number":309,"context_line":"            for sg_key, ports in pool_ports.items():"},{"line_number":310,"context_line":"                if sg_id not in sg_key:"},{"line_number":311,"context_line":"                    continue"},{"line_number":312,"context_line":"                # remove the pool associated to that SG"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_0fe8df78","line":309,"range":{"start_line":306,"start_character":0,"end_line":309,"end_character":52},"in_reply_to":"3fa7e38b_5f79be2d","updated":"2020-01-02 09:58:12.000000000","message":"Hmm. This might be connected with a value returned by .items() method in python3. While in python2 we have a list of tuples, which is kind of snapshot of the dictionary state in a moment of calling .items() method, than in python3 its a \"view\" like object linked directly with the dictionary itself.\n\nObviously something was added/removed from _available_ports_pools during for loop iteration, so the simplest solution would be to make a copy of the items. It\u0027s, however, out of scope for this change.","commit_id":"dcd698593e8448a49170b48a811a4abf61cfaf3e"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"8ceafefea70a34cbe39850c88d1d14e6b53fee4d","unresolved":false,"context_lines":[{"line_number":1004,"context_line":"                        for p_id in sg_ports]"},{"line_number":1005,"context_line":"            try:"},{"line_number":1006,"context_line":"                self._drv_vif._remove_subports(trunk_id, ports_id)"},{"line_number":1007,"context_line":"            except os_exc.SDKException:"},{"line_number":1008,"context_line":"                LOG.exception(\u0027Error removing subports from trunk: %s\u0027,"},{"line_number":1009,"context_line":"                              trunk_id)"},{"line_number":1010,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_e26b3ced","line":1007,"range":{"start_line":1007,"start_character":12,"end_line":1007,"end_character":39},"updated":"2019-12-23 11:27:09.000000000","message":"seems it is possible not all exceptions are catched here: http://paste.openstack.org/show/787856/","commit_id":"dcd698593e8448a49170b48a811a4abf61cfaf3e"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"b6ed7381134b518942dc3c0afedd21e296b6746c","unresolved":false,"context_lines":[{"line_number":1004,"context_line":"                        for p_id in sg_ports]"},{"line_number":1005,"context_line":"            try:"},{"line_number":1006,"context_line":"                self._drv_vif._remove_subports(trunk_id, ports_id)"},{"line_number":1007,"context_line":"            except os_exc.SDKException:"},{"line_number":1008,"context_line":"                LOG.exception(\u0027Error removing subports from trunk: %s\u0027,"},{"line_number":1009,"context_line":"                              trunk_id)"},{"line_number":1010,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_ef0c6345","line":1007,"range":{"start_line":1007,"start_character":12,"end_line":1007,"end_character":39},"in_reply_to":"3fa7e38b_e26b3ced","updated":"2020-01-02 09:58:12.000000000","message":"In that case, we also should catch topmost HTTP exception class, just to cover not only conflict, but also other types of exceptions caused by requests lib.","commit_id":"dcd698593e8448a49170b48a811a4abf61cfaf3e"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"01453ee7e3c76e422aac6bd1a5148f30c1b4065a","unresolved":false,"context_lines":[{"line_number":1004,"context_line":"                        for p_id in sg_ports]"},{"line_number":1005,"context_line":"            try:"},{"line_number":1006,"context_line":"                self._drv_vif._remove_subports(trunk_id, ports_id)"},{"line_number":1007,"context_line":"            except os_exc.SDKException:"},{"line_number":1008,"context_line":"                LOG.exception(\u0027Error removing subports from trunk: %s\u0027,"},{"line_number":1009,"context_line":"                              trunk_id)"},{"line_number":1010,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":11,"id":"3fa7e38b_a5d30e63","line":1007,"range":{"start_line":1007,"start_character":12,"end_line":1007,"end_character":39},"in_reply_to":"3fa7e38b_e26b3ced","updated":"2019-12-23 12:06:58.000000000","message":"Looks like openstacksdk suppresses exceptions for methods written like [1] because raise_exc\u003dFalse is passed later on to requests [2]. Those methods should have error handling embedded in there, but since they don\u0027t we need to handle it here.\n\nI believe this affects instances of add_subports as well.\n\n[1] https://github.com/openstack/openstacksdk/blob/e25e97720135dc3f59647758363edef24d6b8639/openstack/network/v2/trunk.py#L61-L65\n[2] https://github.com/openstack/openstacksdk/blob/9f09a9aef254bbe9f30fa7de8da03e2803ee9e83/openstack/proxy.py#L94-L98","commit_id":"dcd698593e8448a49170b48a811a4abf61cfaf3e"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"96e760dc5089c39fa45cc561aede86ce50376078","unresolved":false,"context_lines":[{"line_number":306,"context_line":"        for pool_key, pool_ports in self._available_ports_pools.items():"},{"line_number":307,"context_line":"            if self._get_pool_key_net(pool_key) !\u003d net_id:"},{"line_number":308,"context_line":"                continue"},{"line_number":309,"context_line":"            for sg_key, ports in pool_ports.items():"},{"line_number":310,"context_line":"                if sg_id not in sg_key:"},{"line_number":311,"context_line":"                    continue"},{"line_number":312,"context_line":"                # remove the pool associated to that SG"}],"source_content_type":"text/x-python","patch_set":12,"id":"3fa7e38b_6d38429e","line":309,"range":{"start_line":309,"start_character":12,"end_line":309,"end_character":52},"updated":"2020-01-08 11:02:58.000000000","message":"also hit it when calling from policy retry: http://paste.openstack.org/show/788162/","commit_id":"f2bee55a6bc2fde662b639d697fa496f56c02f4c"}]}
