Add type annotations to ironicclient/osc/v1/baremetal_create.py

Changes:
Add type annotations following code conventions.
Added file to the migrated files list.

Change-Id: Ia1f2f00a44a7d88e43d1d4f638b763c46ef2e32d
Signed-off-by: Karan Anand <anandkarancompsci@gmail.com>
This commit is contained in:
Karan Anand
2026-03-21 17:22:31 -04:00
parent c7c9463e55
commit c6b7c58414
2 changed files with 15 additions and 8 deletions

View File

@@ -10,21 +10,26 @@
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import annotations
import argparse
import logging
from osc_lib.command import command
from ironicclient.common.i18n import _
from ironicclient.osc import command
from ironicclient.v1 import create_resources
class CreateBaremetal(command.Command):
"""Create resources from files"""
log = logging.getLogger(__name__ + ".CreateBaremetal")
log: logging.Logger = logging.getLogger(
__name__ + ".CreateBaremetal")
def get_parser(self, prog_name):
parser = super(CreateBaremetal, self).get_parser(prog_name)
def get_parser( # type: ignore[override]
self, prog_name: str,
) -> argparse.ArgumentParser:
parser: argparse.ArgumentParser = super().get_parser(prog_name)
parser.add_argument(
"resource_files", metavar="<file>", nargs="+",
@@ -32,6 +37,7 @@ class CreateBaremetal(command.Command):
"resources to create. Can be specified multiple times."))
return parser
def take_action(self, parsed_args):
create_resources.create_resources(self.app.client_manager.baremetal,
parsed_args.resource_files)
def take_action(self, parsed_args: argparse.Namespace) -> None:
create_resources.create_resources(
self.app.client_manager.baremetal,
parsed_args.resource_files)

View File

@@ -41,4 +41,5 @@ files = [
"ironicclient/__init__.py",
"ironicclient/osc/plugin.py",
"ironicclient/osc/v1/baremetal_shard.py",
"ironicclient/osc/v1/baremetal_create.py",
]