From: Tim Serong Date: Fri, 19 Oct 2018 08:25:45 +0000 (+1100) Subject: mgr/orchestrator: use result property in Completion classes X-Git-Tag: v14.1.0~1149^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F24672%2Fhead;p=ceph.git mgr/orchestrator: use result property in Completion classes The _Completion class defined a get_result() method, but the orchestrator CLI and Rook module both just expected a result property, so let's run with the property version. Signed-off-by: Tim Serong --- diff --git a/src/pybind/mgr/orchestrator.py b/src/pybind/mgr/orchestrator.py index 43eee7da630d..a66ff53ffd32 100644 --- a/src/pybind/mgr/orchestrator.py +++ b/src/pybind/mgr/orchestrator.py @@ -7,7 +7,8 @@ Please see the ceph-mgr module developer's guide for more information. class _Completion(object): - def get_result(self): + @property + def result(self): """ Return the result of the operation that we were waited for. Only valid after calling Orchestrator.wait() on this diff --git a/src/pybind/mgr/rook/module.py b/src/pybind/mgr/rook/module.py index aadbdd50535f..bbc0ceebb7a3 100644 --- a/src/pybind/mgr/rook/module.py +++ b/src/pybind/mgr/rook/module.py @@ -33,7 +33,7 @@ class RookReadCompletion(orchestrator.ReadCompletion): def __init__(self, cb): super(RookReadCompletion, self).__init__() self.cb = cb - self.result = None + self._result = None self._complete = False self.message = "" @@ -42,12 +42,16 @@ class RookReadCompletion(orchestrator.ReadCompletion): global all_completions all_completions.append(self) + @property + def result(self): + return self._result + @property def is_complete(self): return self._complete def execute(self): - self.result = self.cb() + self._result = self.cb() self._complete = True