コード例 #1
0
    def initial_data_sender(self):

        logger.info("Sending initial data.")

        operation = SofOperation()

        if settings.AgentId != "":
            self._check_for_reboot()
            self._check_for_shutdown()

            operation.type = OperationValue.Startup

        else:
            operation.type = OperationValue.NewAgent

        self.process_operation(operation.to_json())
コード例 #2
0
    def initial_data_sender(self):

        logger.info("Sending initial data.")

        operation = SofOperation()

        if settings.AgentId != "":
            self._check_for_reboot()
            self._check_for_shutdown()

            operation.type = OperationValue.Startup

        else:
            operation.type = OperationValue.NewAgent

        self.process_operation(operation.to_json())
コード例 #3
0
    def _restart_if_needed(self, operation_restart, restart_needed):
        restart = False

        if operation_restart == RvOperationValue.ForcedRestart:
            restart = True

        elif (operation_restart == RvOperationValue.OptionalRestart
              and restart_needed):
            restart = True

        if restart:
            restart_op = SofOperation()
            restart_op.type = OperationValue.Reboot
            self._register_operation(restart_op)
コード例 #4
0
    def _restart_if_needed(self, operation_restart, restart_needed):
        restart = False

        if operation_restart == RvOperationValue.ForcedRestart:
            restart = True

        elif (operation_restart == RvOperationValue.OptionalRestart and
              restart_needed):
            restart = True

        if restart:
            restart_op = SofOperation()
            restart_op.type = OperationValue.Reboot
            self._register_operation(restart_op)