When generating JSON/YAML from result objects make the status
information and success field placed after the resource
summary. This makes it easier to find these fields when
reading the output of a command (at least for this reader).
Signed-off-by: John Mulligan <jmulligan@redhat.com>
self.status = status
def to_simplified(self) -> Simplified:
- ds: Simplified = dict(self.status or {})
+ ds: Simplified = {}
ds['resource'] = self.src.to_simplified()
- ds['success'] = self.success
+ if self.status:
+ ds.update(self.status)
if self.msg:
ds['msg'] = self.msg
+ ds['success'] = self.success
return ds
def mgr_return_value(self) -> int:
def to_simplified(self) -> Simplified:
return {
- 'success': self.success,
'results': [r.to_simplified() for r in self._contents],
+ 'success': self.success,
}
def mgr_return_value(self) -> int: