Skip to content

Commit fcfbbd0

Browse files
committed
Add skip_bmc_config parameter to create_machine to skip re-config of BMC
1 parent fec3b50 commit fcfbbd0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

maas/client/viscera/machines.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ async def create(
6262
subarchitecture: str = None,
6363
min_hwe_kernel: str = None,
6464
hostname: str = None,
65-
domain: typing.Union[int, str] = None
65+
domain: typing.Union[int, str] = None,
66+
skip_bmc_config: bool = None,
6667
):
6768
"""
6869
Create a new machine.
@@ -84,6 +85,8 @@ async def create(
8485
:type hostname: `str`
8586
:param domain: The domain for the machine (optional).
8687
:type domain: `int` or `str`
88+
:param skip_bmc_config: Do not re-configure BMC (optional).
89+
:type skip_bmc_config: `bool`
8790
"""
8891
params = {
8992
"architecture": architecture,
@@ -100,6 +103,8 @@ async def create(
100103
params["hostname"] = hostname
101104
if domain is not None:
102105
params["domain"] = domain
106+
if skip_bmc_config is not None:
107+
params["skip_bmc_config"] = skip_bmc_config
103108
return cls._object(await cls._handler.create(**params))
104109

105110
async def allocate(

maas/client/viscera/tests/test_machines.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,7 @@ def test__create(self):
915915
min_hwe_kernel="hwe-x",
916916
hostname="new-machine",
917917
domain="maas",
918+
skip_bmc_config=True,
918919
)
919920
self.assertThat(observed, IsInstance(Machine))
920921
Machines._handler.create.assert_called_once_with(
@@ -928,6 +929,7 @@ def test__create(self):
928929
min_hwe_kernel="hwe-x",
929930
hostname="new-machine",
930931
domain="maas",
932+
skip_bmc_config=True,
931933
)
932934

933935
def test__allocate(self):

0 commit comments

Comments
 (0)