Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add skip_bmc_config parameter to create_machine to skip re-config of BMC #294

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
Loading