diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-06-03 05:26:01 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-06-03 05:26:02 +0000 |
| commit | 98268db8bb15f428d845b0a76053b1c64291e4ab (patch) | |
| tree | 1bcd9c31922bb1a1d962429fd085ec1ea527d6b6 /kolla/common | |
| parent | fca876cdd10d9ca09934ee04ff8f40b5c4b7f60a (diff) | |
| parent | e78ae9bc618dff1ed38db1f5013d7f1735124790 (diff) | |
| download | kolla-98268db8bb15f428d845b0a76053b1c64291e4ab.tar.gz kolla-98268db8bb15f428d845b0a76053b1c64291e4ab.zip | |
Merge "Use a task model and dumb workers"3.0.0.0b1
Diffstat (limited to 'kolla/common')
| -rw-r--r-- | kolla/common/task.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/kolla/common/task.py b/kolla/common/task.py new file mode 100644 index 000000000..255abf85c --- /dev/null +++ b/kolla/common/task.py @@ -0,0 +1,42 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import abc + +import six + + +@six.add_metaclass(abc.ABCMeta) +class Task(object): + + def __init__(self): + self.success = False + + @abc.abstractproperty + def name(self): + pass + + def reset(self): + self.success = False + + @property + def followups(self): + return [] + + @abc.abstractmethod + def run(self): + pass + + @staticmethod + def set_status(status): + # TODO(harlowja): remove this. + pass |
