-
Notifications
You must be signed in to change notification settings - Fork 493
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
505fa8a
commit 43a8a7a
Showing
5 changed files
with
80 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/middlewared/middlewared/api/v25_04_0/failover_reboot.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright (c) - iXsystems Inc. | ||
# | ||
# Licensed under the terms of the TrueNAS Enterprise License Agreement | ||
# See the file LICENSE.IX for complete terms and conditions | ||
from middlewared.api.base import BaseModel, single_argument_result | ||
|
||
__all__ = ["FailoverRebootRequiredArgs", "FailoverRebootRequiredResult"] | ||
|
||
|
||
class FailoverRebootRequiredArgs(BaseModel): | ||
pass | ||
|
||
|
||
class FailoverRebootRequiredResultThisNode(BaseModel): | ||
id: str | ||
reboot_required: bool | ||
reboot_required_reasons: list[str] | ||
|
||
|
||
class FailoverRebootRequiredResultOtherNode(FailoverRebootRequiredResultThisNode): | ||
id: str | None | ||
reboot_required: bool | None | ||
|
||
|
||
@single_argument_result | ||
class FailoverRebootRequiredResult(BaseModel): | ||
this_node: FailoverRebootRequiredResultThisNode | ||
other_node: FailoverRebootRequiredResultOtherNode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# These tests need to be executing at the very last stage of the testing process as they semi-break the system | ||
# in different ways. | ||
from middlewared.test.integration.utils import call | ||
|
||
|
||
def test_failover_reboot_add_reason(): | ||
info = call("failover.reboot.info") | ||
assert not info["this_node"]["reboot_required"] | ||
assert info["this_node"]["reboot_required_reasons"] == [] | ||
|
||
call("failover.reboot.add_reason", "test", "Test reason.") | ||
|
||
info = call("failover.reboot.info") | ||
assert info["this_node"]["reboot_required"] | ||
assert info["this_node"]["reboot_required_reasons"] == ["Test reason."] |