Source code for setup_wizard
"""This Package contains the setup wizard django application."""
from __future__ import annotations
import enum
from pathlib import Path
[docs]
class SetupWizardState(enum.Enum):
"""This enum represents the current setup wizard state of the trustpoint."""
[docs]
WIZARD_TLS_SERVER_CREDENTIAL_APPLY = WIZARD_STATE_PATH / Path('WIZARD_TLS_SERVER_CREDENTIAL_APPLY')
@classmethod
[docs]
def get_current_state(cls) -> SetupWizardState:
"""Gets the current setup wizard state of the trustpoint.
Returns:
The current setup wizard state.
Raises:
RuntimeError: If the current setup wizard state cannot be determined.
"""
for member in cls:
if member.value.is_file():
return member
err_msg = 'Failed to determine wizard state.'
raise RuntimeError(err_msg)