Example #1
0
 def _init_state_map(self) -> None:
     self._state_map = {
         'wait_inform': WaitInformState(self, when_done='get_rpc_methods'),
         'get_rpc_methods': GetRPCMethodsState(self, when_done='wait_empty', when_skip='get_transient_params'),
         'wait_empty': WaitEmptyMessageState(self, when_done='get_transient_params'),
         'get_transient_params': SendGetTransientParametersState(self, when_done='wait_get_transient_params'),
         'wait_get_transient_params': WaitGetTransientParametersState(self, when_get='get_params', when_get_obj_params='get_obj_params', when_delete='delete_objs', when_add='add_objs', when_set='set_params', when_skip='end_session'),
         'get_params': GetParametersState(self, when_done='wait_get_params'),
         'wait_get_params': WaitGetParametersState(self, when_done='get_obj_params'),
         'get_obj_params': CaviumGetObjectParametersState(self, when_done='wait_get_obj_params'),
         'wait_get_obj_params': CaviumWaitGetObjectParametersState(self, when_edit='disable_admin', when_skip='get_transient_params'),
         'disable_admin': CaviumDisableAdminEnableState(self, admin_value=False, when_done='wait_disable_admin'),
         'wait_disable_admin': CaviumWaitDisableAdminEnableState(self, admin_value=False, when_add='add_objs', when_delete='delete_objs', when_done='set_params'),
         'delete_objs': DeleteObjectsState(self, when_add='add_objs', when_skip='set_params'),
         'add_objs': AddObjectsState(self, when_done='set_params'),
         'set_params': SetParameterValuesNotAdminState(self, when_done='wait_set_params'),
         'wait_set_params': WaitSetParameterValuesState(self, when_done='enable_admin', when_apply_invasive='enable_admin'),
         'enable_admin': CaviumDisableAdminEnableState(self, admin_value=True, when_done='wait_enable_admin'),
         'wait_enable_admin': CaviumWaitDisableAdminEnableState(self, admin_value=True, when_done='check_get_params', when_add='check_get_params', when_delete='check_get_params'),
         'check_get_params': GetParametersState(self, when_done='check_wait_get_params', request_all_params=True),
         'check_wait_get_params': WaitGetParametersState(self, when_done='end_session'),
         'end_session': EndSessionState(self),
         # Below states only entered through manual user intervention
         'reboot': SendRebootState(self, when_done='wait_reboot'),
         'wait_reboot': WaitRebootResponseState(self, when_done='wait_post_reboot_inform'),
         'wait_post_reboot_inform': WaitInformMRebootState(self, when_done='wait_reboot_delay', when_timeout='wait_inform'),
         # The states below are entered when an unexpected message type is
         # received
         'unexpected_fault': ErrorState(self, inform_transition_target='wait_inform'),
     }
Example #2
0
 def _init_state_map(self) -> None:
     self._state_map = {
         'wait_inform':
         WaitInformState(self, when_done='get_rpc_methods'),
         'get_rpc_methods':
         GetRPCMethodsState(self,
                            when_done='wait_empty',
                            when_skip='get_transient_params'),
         'wait_empty':
         WaitEmptyMessageState(self, when_done='get_transient_params'),
         'get_transient_params':
         SendGetTransientParametersState(
             self, when_done='wait_get_transient_params'),
         'wait_get_transient_params':
         BaicellsQafbWaitGetTransientParametersState(
             self,
             when_get='get_params',
             when_get_obj_params='get_obj_params',
             when_delete='delete_objs',
             when_add='add_objs',
             when_set='set_params',
             when_skip='end_session'),
         'get_params':
         GetParametersState(self, when_done='wait_get_params'),
         'wait_get_params':
         WaitGetParametersState(self, when_done='get_obj_params'),
         'get_obj_params':
         BaicellsQafbGetObjectParametersState(self,
                                              when_delete='delete_objs',
                                              when_add='add_objs',
                                              when_set='set_params',
                                              when_skip='end_session'),
         'delete_objs':
         DeleteObjectsState(self,
                            when_add='add_objs',
                            when_skip='set_params'),
         'add_objs':
         AddObjectsState(self, when_done='set_params'),
         'set_params':
         SetParameterValuesState(self, when_done='wait_set_params'),
         'wait_set_params':
         WaitSetParameterValuesState(
             self,
             when_done='check_get_params',
             when_apply_invasive='check_get_params'),
         'check_get_params':
         GetParametersState(self,
                            when_done='check_wait_get_params',
                            request_all_params=True),
         'check_wait_get_params':
         WaitGetParametersState(self, when_done='end_session'),
         'end_session':
         EndSessionState(self),
         # These states are only entered through manual user intervention
         'reboot':
         BaicellsSendRebootState(self, when_done='wait_reboot'),
         'wait_reboot':
         WaitRebootResponseState(self, when_done='wait_post_reboot_inform'),
         'wait_post_reboot_inform':
         WaitInformMRebootState(self,
                                when_done='wait_empty',
                                when_timeout='wait_inform'),
         # The states below are entered when an unexpected message type is
         # received
         'unexpected_fault':
         ErrorState(self),
     }