Beispiel #1
0
    def register_operation(self, trigger_id, operation_id, **kwargs):
        if trigger_id not in self._trigger:
            self._trigger[trigger_id] = []

        if operation_id in self._trigger[trigger_id]:
            raise exception.ScheduledOperationExist(op_id=operation_id)

        self._trigger[trigger_id].append(operation_id)
Beispiel #2
0
    def register_operation(self, operation_id, **kwargs):
        if operation_id in self._operation_ids:
            msg = (_("The operation_id(%s) is exist") % operation_id)
            raise exception.ScheduledOperationExist(msg)

        if self._greenthread and not self._greenthread.running:
            raise exception.TriggerIsInvalid(trigger_id=self._id)

        self._operation_ids.add(operation_id)
        if self._greenthread is None:
            self._start_greenthread()
Beispiel #3
0
    def register_operation(self, operation_id, **kwargs):
        if operation_id in self._operation_ids:
            msg = (_("The operation_id(%s) is exist") % operation_id)
            raise exception.ScheduledOperationExist(msg)

        self._operation_ids.add(operation_id)