)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bec72e5d556dd780f029cbce0b210a1e146aef52","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"356871bb_a45c3142","updated":"2026-05-11 12:52:09.000000000","message":"there are some issues with","commit_id":"ef127a385fb90d00aa775fc38d4adb310615a1f4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"2261744d5a5937041afacbf1409a16f6f73aa724","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"6eff4f90_97049677","updated":"2026-05-12 09:28:15.000000000","message":"recheck","commit_id":"dc460785a59da949d7ce5eecaf19817d78dacbee"}],"vif_plug_ovs/linux_net.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bec72e5d556dd780f029cbce0b210a1e146aef52","unresolved":true,"context_lines":[{"line_number":50,"context_line":"NIC_NAME_LEN \u003d 14"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def _update_device_mtu(dev: str, mtu: int) -\u003e None:"},{"line_number":54,"context_line":"    if not mtu:"},{"line_number":55,"context_line":"        return"},{"line_number":56,"context_line":"    set_device_mtu(dev, mtu)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9d4b2304_692d0c1a","line":53,"range":{"start_line":53,"start_character":38,"end_line":53,"end_character":41},"updated":"2026-05-11 12:52:09.000000000","message":"i belive this should be int | None because we expect this to be None in some cases\n\nperhaps when the network is using the default mtu i.e. 1500\n\ni think neutgron doe snot provide it in that case alshtought htat could have been the  nova net code path.\n\nwe also need to handel 0 as \"use the default of the systemn\"\n\ni.e. dont set it at all which is the other reasons for the if.","commit_id":"ef127a385fb90d00aa775fc38d4adb310615a1f4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"300ecceb53d906034bd66271a6926c7a278f1c37","unresolved":false,"context_lines":[{"line_number":50,"context_line":"NIC_NAME_LEN \u003d 14"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def _update_device_mtu(dev: str, mtu: int) -\u003e None:"},{"line_number":54,"context_line":"    if not mtu:"},{"line_number":55,"context_line":"        return"},{"line_number":56,"context_line":"    set_device_mtu(dev, mtu)"}],"source_content_type":"text/x-python","patch_set":7,"id":"10cf931f_9c5d2a4d","line":53,"range":{"start_line":53,"start_character":38,"end_line":53,"end_character":41},"in_reply_to":"9d4b2304_692d0c1a","updated":"2026-05-11 13:20:38.000000000","message":"I don\u0027t believe so. This has 3 callers: `create_veth_pair`, `update_veth_pair` and `create_tap`. Both `create_veth_pair` and `update_veth_pair` are called by `OvsPlugin._plug_bridge` which passes generates its `mtu` via a call to `_get_mtu`. `create_tap` is called by `OvsPlugin._create_vif_port` which again uses `_get_mtu` to build an `mtu` value. `_get_mtu` will attempt to retrieve the `mtu` from the port\u0027s `network` field but will check if it\u0027s set and truthy (so not `0` or `None`). If it\u0027s falsey, it will fallback to the `network_device_mtu` oslo.config option. You can see that [here](https://opendev.org/openstack/os-vif/src/commit/22dcd8d18a08bc9cacfe3deeb79ee1072e17bc9d/vif_plug_ovs/ovs.py#L177-L180). [That is *not* nullable and defaults to `1500`](https://opendev.org/openstack/os-vif/src/commit/22dcd8d18a08bc9cacfe3deeb79ee1072e17bc9d/vif_plug_ovs/ovs.py#L56-L59), so `_get_mtu` will therefore always returns a non-`None` value.","commit_id":"ef127a385fb90d00aa775fc38d4adb310615a1f4"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"b52ad3089c32cdbdc2b7a0d9b91f56b9566d5dd7","unresolved":true,"context_lines":[{"line_number":385,"context_line":"    \"\"\""},{"line_number":386,"context_line":"    virtfns_path \u003d \"/sys/bus/pci/devices/%s/physfn/virtfn*\" % (pci_addr)"},{"line_number":387,"context_line":"    vf_num \u003d None"},{"line_number":388,"context_line":"    for vf_path in glob.iglob(virtfns_path):"},{"line_number":389,"context_line":"        try:"},{"line_number":390,"context_line":"            link \u003d os.readlink(vf_path)"},{"line_number":391,"context_line":"        except OSError:"},{"line_number":392,"context_line":"            continue"},{"line_number":393,"context_line":"        if re.search(pci_addr, link):"},{"line_number":394,"context_line":"            match \u003d VIRTFN_RE.search(vf_path)"},{"line_number":395,"context_line":"            if match:"},{"line_number":396,"context_line":"                vf_num \u003d match.group(1)"},{"line_number":397,"context_line":"                break"},{"line_number":398,"context_line":""},{"line_number":399,"context_line":"    if vf_num is None:"},{"line_number":400,"context_line":"        raise exception.PciDeviceNotFoundById(id\u003dpci_addr)"}],"source_content_type":"text/x-python","patch_set":8,"id":"f590c888_528ab534","line":397,"range":{"start_line":388,"start_character":4,"end_line":397,"end_character":21},"updated":"2026-05-11 14:47:38.000000000","message":"We change a bit the logic here.","commit_id":"dc460785a59da949d7ce5eecaf19817d78dacbee"}],"vif_plug_ovs/ovs.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bec72e5d556dd780f029cbce0b210a1e146aef52","unresolved":true,"context_lines":[{"line_number":185,"context_line":"    def _get_mtu(self, vif: objects.VIFBase) -\u003e int:"},{"line_number":186,"context_line":"        if vif.network and vif.network.mtu:"},{"line_number":187,"context_line":"            # TODO(stephenfin: this looks like a bug in the o.vo mypy plugin"},{"line_number":188,"context_line":"            return cast(int, vif.network.mtu)"},{"line_number":189,"context_line":"        # oslo.config is untyped"},{"line_number":190,"context_line":"        return cast(int, self.config.network_device_mtu)"},{"line_number":191,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"b5e3f468_568e1b47","line":188,"updated":"2026-05-11 12:52:09.000000000","message":"https://opendev.org/openstack/os-vif/src/commit/ef127a385fb90d00aa775fc38d4adb310615a1f4/os_vif/objects/network.py#L42\n\nno we define this as a nullable int because there are cases where it is not set and is None\n\ngranted in those case this if should be false but i would guess that is why this need a cast.\nyou could add an asset instead of a cast here.","commit_id":"ef127a385fb90d00aa775fc38d4adb310615a1f4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"300ecceb53d906034bd66271a6926c7a278f1c37","unresolved":false,"context_lines":[{"line_number":185,"context_line":"    def _get_mtu(self, vif: objects.VIFBase) -\u003e int:"},{"line_number":186,"context_line":"        if vif.network and vif.network.mtu:"},{"line_number":187,"context_line":"            # TODO(stephenfin: this looks like a bug in the o.vo mypy plugin"},{"line_number":188,"context_line":"            return cast(int, vif.network.mtu)"},{"line_number":189,"context_line":"        # oslo.config is untyped"},{"line_number":190,"context_line":"        return cast(int, self.config.network_device_mtu)"},{"line_number":191,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"69658a86_e1b8cc5d","line":188,"in_reply_to":"b5e3f468_568e1b47","updated":"2026-05-11 13:20:38.000000000","message":"The cast is on the return value, not the attribute. I could also write this like so but it\u0027d be unnecessary:\n\n```suggestion\n            ret \u003d vif.network.mtu\n            return cast(int, ret)\n```\n\nWe know here that this will be set and will not be `None` due to truthy check on the line above (`if vif.network and vif.network.mtu`).\n\nThe comment refers to the fact that the mypy plugin is not narrowing its type (which should be `int | None`, or `int` here due to the above truthy check) but rather representing it as `Any`. You can prove this locally by adding e.g. `reveal_type(vif.network.mtu`) on the line above. That\u0027s a bug that I will address.","commit_id":"ef127a385fb90d00aa775fc38d4adb310615a1f4"}],"vif_plug_ovs/ovsdb/api.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bec72e5d556dd780f029cbce0b210a1e146aef52","unresolved":true,"context_lines":[{"line_number":16,"context_line":"from typing import Literal, overload, TYPE_CHECKING"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"if TYPE_CHECKING:"},{"line_number":19,"context_line":"    from vif_plug_ovs.ovsdb.impl_idl import NeutronOvsdbIdl"},{"line_number":20,"context_line":"    from vif_plug_ovs.ovsdb.impl_vsctl import OvsdbVsctl"},{"line_number":21,"context_line":"    from vif_plug_ovs.ovsdb.ovsdb_lib import BaseOVS"},{"line_number":22,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"002f4bf0_a8e90c6d","line":19,"range":{"start_line":19,"start_character":4,"end_line":19,"end_character":59},"updated":"2026-05-11 12:52:09.000000000","message":"i woudl strongly perfer if you dint voilate oru improt convetion here adn isntead did\nfrom vif_plug_ovs.ovsdb import impl_idl\n\nand did impl_idl.NeutronOvsdbIdl below","commit_id":"ef127a385fb90d00aa775fc38d4adb310615a1f4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"300ecceb53d906034bd66271a6926c7a278f1c37","unresolved":false,"context_lines":[{"line_number":16,"context_line":"from typing import Literal, overload, TYPE_CHECKING"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"if TYPE_CHECKING:"},{"line_number":19,"context_line":"    from vif_plug_ovs.ovsdb.impl_idl import NeutronOvsdbIdl"},{"line_number":20,"context_line":"    from vif_plug_ovs.ovsdb.impl_vsctl import OvsdbVsctl"},{"line_number":21,"context_line":"    from vif_plug_ovs.ovsdb.ovsdb_lib import BaseOVS"},{"line_number":22,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"94595328_f5e10180","line":19,"range":{"start_line":19,"start_character":4,"end_line":19,"end_character":59},"in_reply_to":"002f4bf0_a8e90c6d","updated":"2026-05-11 13:20:38.000000000","message":"Done","commit_id":"ef127a385fb90d00aa775fc38d4adb310615a1f4"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bec72e5d556dd780f029cbce0b210a1e146aef52","unresolved":true,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"@overload"},{"line_number":31,"context_line":"def get_instance("},{"line_number":32,"context_line":"    context: BaseOVS, iface_name: Literal[\u0027vsctl\u0027]"},{"line_number":33,"context_line":") -\u003e OvsdbVsctl:"},{"line_number":34,"context_line":"    ..."},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"f666419f_ce3d6551","line":32,"range":{"start_line":32,"start_character":43,"end_line":32,"end_character":48},"updated":"2026-05-11 12:52:09.000000000","message":"nit: i would be tempeted to define these as constats and reuse them","commit_id":"ef127a385fb90d00aa775fc38d4adb310615a1f4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"300ecceb53d906034bd66271a6926c7a278f1c37","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"@overload"},{"line_number":31,"context_line":"def get_instance("},{"line_number":32,"context_line":"    context: BaseOVS, iface_name: Literal[\u0027vsctl\u0027]"},{"line_number":33,"context_line":") -\u003e OvsdbVsctl:"},{"line_number":34,"context_line":"    ..."},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"f0659034_caf163a5","line":32,"range":{"start_line":32,"start_character":43,"end_line":32,"end_character":48},"in_reply_to":"f666419f_ce3d6551","updated":"2026-05-11 13:20:38.000000000","message":"We have only one user here so I believe that would be overkill for now. We can add it in the future though if there are more reasons to consume this.","commit_id":"ef127a385fb90d00aa775fc38d4adb310615a1f4"}],"vif_plug_ovs/ovsdb/impl_idl.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bec72e5d556dd780f029cbce0b210a1e146aef52","unresolved":true,"context_lines":[{"line_number":27,"context_line":"from vif_plug_ovs.ovsdb import api"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"if TYPE_CHECKING:"},{"line_number":30,"context_line":"    from vif_plug_ovs.ovsdb.ovsdb_lib import BaseOVS"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"REQUIRED_TABLES \u003d (\u0027Interface\u0027, \u0027Port\u0027, \u0027Bridge\u0027, \u0027Open_vSwitch\u0027, \u0027QoS\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"e4823705_520c09f0","line":30,"updated":"2026-05-11 12:52:09.000000000","message":"same here im not going to keep pointing this out but this does make me wonder if i would prefer to just not do typeing if we have tro allow improting non module symblos in TYPE_CHECKING blcoks","commit_id":"ef127a385fb90d00aa775fc38d4adb310615a1f4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"300ecceb53d906034bd66271a6926c7a278f1c37","unresolved":false,"context_lines":[{"line_number":27,"context_line":"from vif_plug_ovs.ovsdb import api"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"if TYPE_CHECKING:"},{"line_number":30,"context_line":"    from vif_plug_ovs.ovsdb.ovsdb_lib import BaseOVS"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"REQUIRED_TABLES \u003d (\u0027Interface\u0027, \u0027Port\u0027, \u0027Bridge\u0027, \u0027Open_vSwitch\u0027, \u0027QoS\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"b5de5e94_3a058f43","line":30,"in_reply_to":"e4823705_520c09f0","updated":"2026-05-11 13:20:38.000000000","message":"Done. (The `TYPE_CHECKING` blocks are necessary to prevent recursive imports.)","commit_id":"ef127a385fb90d00aa775fc38d4adb310615a1f4"}],"vif_plug_ovs/ovsdb/impl_vsctl.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bec72e5d556dd780f029cbce0b210a1e146aef52","unresolved":true,"context_lines":[{"line_number":106,"context_line":"            res.replace(r\u0027\\\\\u0027, \u0027\\\\\u0027).splitlines()"},{"line_number":107,"context_line":"        ):"},{"line_number":108,"context_line":"            self.commands[i].result \u003d record"},{"line_number":109,"context_line":"        return [cmd.result for cmd in self.commands if cmd.result]"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    def run_vsctl(self, args: list[str]) -\u003e str | None:"},{"line_number":112,"context_line":"        full_args \u003d [\"ovs-vsctl\"] + self.opts + args"}],"source_content_type":"text/x-python","patch_set":7,"id":"5e51d41f_e3861f13","line":109,"range":{"start_line":109,"start_character":52,"end_line":109,"end_character":65},"updated":"2026-05-11 12:52:09.000000000","message":"this technically chagne the behiuvor if the reulst is the empty strign or none","commit_id":"ef127a385fb90d00aa775fc38d4adb310615a1f4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"300ecceb53d906034bd66271a6926c7a278f1c37","unresolved":false,"context_lines":[{"line_number":106,"context_line":"            res.replace(r\u0027\\\\\u0027, \u0027\\\\\u0027).splitlines()"},{"line_number":107,"context_line":"        ):"},{"line_number":108,"context_line":"            self.commands[i].result \u003d record"},{"line_number":109,"context_line":"        return [cmd.result for cmd in self.commands if cmd.result]"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    def run_vsctl(self, args: list[str]) -\u003e str | None:"},{"line_number":112,"context_line":"        full_args \u003d [\"ovs-vsctl\"] + self.opts + args"}],"source_content_type":"text/x-python","patch_set":7,"id":"3196638f_f345d336","line":109,"range":{"start_line":109,"start_character":52,"end_line":109,"end_character":65},"in_reply_to":"5e51d41f_e3861f13","updated":"2026-05-11 13:20:38.000000000","message":"I can split this out if you want since it\u0027s the correct thing to do but it seems a very unlikely bug to hit.","commit_id":"ef127a385fb90d00aa775fc38d4adb310615a1f4"}],"vif_plug_ovs/ovsdb/ovsdb_lib.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bec72e5d556dd780f029cbce0b210a1e146aef52","unresolved":true,"context_lines":[{"line_number":167,"context_line":"        iface_id: str,"},{"line_number":168,"context_line":"        mac: str,"},{"line_number":169,"context_line":"        instance_id: str,"},{"line_number":170,"context_line":"        mtu: int | None \u003d None,"},{"line_number":171,"context_line":"        interface_type: str | None \u003d None,"},{"line_number":172,"context_line":"        vhost_server_path: str | None \u003d None,"},{"line_number":173,"context_line":"        tag: int | None \u003d None,"}],"source_content_type":"text/x-python","patch_set":7,"id":"5df1966c_20cf6eb8","line":170,"updated":"2026-05-11 12:52:09.000000000","message":"see even here we have mtu as None by default so we shudl be expecting it to be a nullable int in outer places.","commit_id":"ef127a385fb90d00aa775fc38d4adb310615a1f4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"300ecceb53d906034bd66271a6926c7a278f1c37","unresolved":true,"context_lines":[{"line_number":167,"context_line":"        iface_id: str,"},{"line_number":168,"context_line":"        mac: str,"},{"line_number":169,"context_line":"        instance_id: str,"},{"line_number":170,"context_line":"        mtu: int | None \u003d None,"},{"line_number":171,"context_line":"        interface_type: str | None \u003d None,"},{"line_number":172,"context_line":"        vhost_server_path: str | None \u003d None,"},{"line_number":173,"context_line":"        tag: int | None \u003d None,"}],"source_content_type":"text/x-python","patch_set":7,"id":"f3ef3410_545125cf","line":170,"in_reply_to":"5df1966c_20cf6eb8","updated":"2026-05-11 13:20:38.000000000","message":"So this has to be `None` because we\u0027re using a default argument on `None`, despite our sole caller *always* passing this argument and providing a non-`None` value. Ditto for the likes of `update_ovs_vif_port` below.\n\nI can fix this inconsistency by making this a kwarg-only argument and dropping the default, but that would be an API change. Do we expect anyone to be calling this method outside os-vif itself?","commit_id":"ef127a385fb90d00aa775fc38d4adb310615a1f4"}]}
