Add a result property, and ensure that the create_osd codepath returns
a string with the result when an exception isn't triggered.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
self.executed = False
# Result of k8s API call, this is set if executed==True
- self.k8s_result = None
+ self._result = None
self.effective = False
global all_completions
all_completions.append(self)
+ @property
+ def result(self):
+ return self._result
+
@property
def is_persistent(self):
return (not self.is_errored) and self.executed
def execute(self):
if not self.executed:
- self.k8s_result = self.execute_cb()
+ self._result = self.execute_cb()
self.executed = True
if not self.effective:
"support OSD creation.")
def execute():
- self.rook_cluster.add_osds(drive_group, all_hosts)
+ return self.rook_cluster.add_osds(drive_group, all_hosts)
def is_complete():
# Find OSD pods on this host
})
if len(patch) == 0:
- log.warning("No-op adding stateful service")
- return
+ return "No change"
try:
self.rook_api_patch(
raise ApplyException(
"Failed to create OSD entries in Cluster CRD: {0}".format(
e))
+
+ return "Success"