Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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