Skip to content

Commit

Permalink
Add skip_bmc_config parameter to create_machine to skip re-config of BMC
Browse files Browse the repository at this point in the history
  • Loading branch information
acormier1 committed Oct 16, 2023
1 parent fec3b50 commit fcfbbd0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion maas/client/viscera/machines.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ async def create(
subarchitecture: str = None,
min_hwe_kernel: str = None,
hostname: str = None,
domain: typing.Union[int, str] = None
domain: typing.Union[int, str] = None,
skip_bmc_config: bool = None,
):
"""
Create a new machine.
Expand All @@ -84,6 +85,8 @@ async def create(
:type hostname: `str`
:param domain: The domain for the machine (optional).
:type domain: `int` or `str`
:param skip_bmc_config: Do not re-configure BMC (optional).
:type skip_bmc_config: `bool`
"""
params = {
"architecture": architecture,
Expand All @@ -100,6 +103,8 @@ async def create(
params["hostname"] = hostname
if domain is not None:
params["domain"] = domain
if skip_bmc_config is not None:
params["skip_bmc_config"] = skip_bmc_config
return cls._object(await cls._handler.create(**params))

async def allocate(
Expand Down
2 changes: 2 additions & 0 deletions maas/client/viscera/tests/test_machines.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,7 @@ def test__create(self):
min_hwe_kernel="hwe-x",
hostname="new-machine",
domain="maas",
skip_bmc_config=True,
)
self.assertThat(observed, IsInstance(Machine))
Machines._handler.create.assert_called_once_with(
Expand All @@ -928,6 +929,7 @@ def test__create(self):
min_hwe_kernel="hwe-x",
hostname="new-machine",
domain="maas",
skip_bmc_config=True,
)

def test__allocate(self):
Expand Down

0 comments on commit fcfbbd0

Please sign in to comment.