)]}'
{"ironicclient/osc/v1/baremetal_shard.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"53cb8bd4291087c2dea187b81bb2df63ef799959","unresolved":true,"context_lines":[{"line_number":13,"context_line":""},{"line_number":14,"context_line":"from __future__ import annotations"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import argparse"},{"line_number":17,"context_line":"from collections.abc import Iterable"},{"line_number":18,"context_line":"from collections.abc import Sequence"},{"line_number":19,"context_line":"import logging"},{"line_number":20,"context_line":"from typing import Any"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"6eea82e3_492e74ae","line":18,"range":{"start_line":16,"start_character":15,"end_line":18,"end_character":36},"updated":"2026-03-27 14:49:08.000000000","message":"If you configure `[hacking] import_exceptions` in `tox.ini` like we do in [e.g. Nova](https://github.com/openstack/nova/blob/ef998652e639228ba387e59de7badb2c5fcd16fa/tox.ini#L346-L350), you\u0027ll be able to put these on one line.","commit_id":"ca64ebeb2977906d1fdd120d08defed9a42eb18f"},{"author":{"_account_id":10342,"name":"Jay Faulkner","display_name":"JayF","email":"jay@jvf.cc","username":"JayF","status":"youtube.com/@oss-gr / podcast.gr-oss.io"},"change_message_id":"5b93a93e921ae5ea23b6205f7bea44be96dee966","unresolved":true,"context_lines":[{"line_number":37,"context_line":"    ) -\u003e tuple[Sequence[str], Iterable[Any]]:"},{"line_number":38,"context_line":"        self.log.debug(\"take_action(%s)\", parsed_args)"},{"line_number":39,"context_line":"        manager \u003d self.app.client_manager"},{"line_number":40,"context_line":"        client \u003d manager.baremetal  # type: ignore[attr-defined]"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"        data \u003d client.shard.list()"},{"line_number":43,"context_line":"        columns \u003d res_fields.SHARD_RESOURCE.fields"}],"source_content_type":"text/x-python","patch_set":4,"id":"15cfbfb7_bad53f0c","line":40,"updated":"2026-03-24 22:19:21.000000000","message":"What do we need to do in order to remove this ignore? It\u0027s code that\u0027s internal to us, so I feel like we should be able to fix it, yeah?","commit_id":"ca64ebeb2977906d1fdd120d08defed9a42eb18f"},{"author":{"_account_id":38828,"name":"Karan Anand","display_name":"Karan","email":"anandkarancompsci@gmail.com","username":"anandkaranubc"},"change_message_id":"ffdd93276eba940eade9f2646101baae55967c12","unresolved":true,"context_lines":[{"line_number":37,"context_line":"    ) -\u003e tuple[Sequence[str], Iterable[Any]]:"},{"line_number":38,"context_line":"        self.log.debug(\"take_action(%s)\", parsed_args)"},{"line_number":39,"context_line":"        manager \u003d self.app.client_manager"},{"line_number":40,"context_line":"        client \u003d manager.baremetal  # type: ignore[attr-defined]"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"        data \u003d client.shard.list()"},{"line_number":43,"context_line":"        columns \u003d res_fields.SHARD_RESOURCE.fields"}],"source_content_type":"text/x-python","patch_set":4,"id":"dfdc16ea_a398543f","line":40,"in_reply_to":"15cfbfb7_bad53f0c","updated":"2026-03-24 22:32:19.000000000","message":"This I am not completely sure how to deal with it in a better way but I can try to explain what the issue is here. \n\n`baremetal` is dynamically injected onto `osc_lib.clientmanager.ClientManager` by the plugin system at runtime (via the setuptools entry point in setup.cfg). it\u0027s not declared anywhere on the class, so mypy has no way to know it exists. since ClientManager is osc-lib\u0027s class, we can\u0027t add the attribute to its definition, right?","commit_id":"ca64ebeb2977906d1fdd120d08defed9a42eb18f"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"d2fe1dc712c5339d257a7cd0a8a25fbedd52ae3a","unresolved":true,"context_lines":[{"line_number":37,"context_line":"    ) -\u003e tuple[Sequence[str], Iterable[Any]]:"},{"line_number":38,"context_line":"        self.log.debug(\"take_action(%s)\", parsed_args)"},{"line_number":39,"context_line":"        manager \u003d self.app.client_manager"},{"line_number":40,"context_line":"        client \u003d manager.baremetal  # type: ignore[attr-defined]"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"        data \u003d client.shard.list()"},{"line_number":43,"context_line":"        columns \u003d res_fields.SHARD_RESOURCE.fields"}],"source_content_type":"text/x-python","patch_set":4,"id":"d1f487aa_c2683615","line":40,"in_reply_to":"dfdc16ea_a398543f","updated":"2026-03-26 12:25:48.000000000","message":"My solution to this issue in OSC proper was this:\n\nhttps://review.opendev.org/c/openstack/python-openstackclient/+/970681\n\nJust to explain what\u0027s going on there, we added a new `command` module that subclasses the osc-lib implementations and [simply pointed their `app` attribute at our own `OpenStackShell` implementation](https://github.com/openstack/python-openstackclient/blob/b031b7d9ab8204ce337032832efaa57c8d0c4a84/openstackclient/command.py#L21), which in turn [points to our `ClientManager`](https://github.com/openstack/python-openstackclient/blob/b031b7d9ab8204ce337032832efaa57c8d0c4a84/openstackclient/shell.py#L39) where [we statically annotate the various client implementations](https://github.com/openstack/python-openstackclient/blob/b031b7d9ab8204ce337032832efaa57c8d0c4a84/openstackclient/common/clientmanager.py#L57-L69). As I\u0027ve noted there, it a bit of a hack but it does give us some degree of type safety.\n\nIf you wanted to do the same, I would suggest you add your own `command` module and then either (a) provide your own subclasses of `OpenStackShell` and `ClientManager` like we did in OSC or (b) use the ones from OSC (optionally, behind `TYPE_CHECKING` guards) and extend OSC\u0027s `ClientManager` to add a `baremetal` attribute.\n\nAlternatively, you could just move all of this code to OSC like [we\u0027re planning to do for manila](https://review.opendev.org/q/topic:%22integrate-manilaclient%22+is:open) and are already doing for neutron stadium projects like [TaaS](https://review.opendev.org/q/file:taas+project:openstack/python-openstackclient) (merged) and [FWaaS](https://review.opendev.org/q/file:fwaas+project:openstack/python-openstackclient) (WIP).","commit_id":"ca64ebeb2977906d1fdd120d08defed9a42eb18f"}]}
