cephadm: Add "--format" option to "ceph orch status"#35805
cephadm: Add "--format" option to "ceph orch status"#35805sebastian-philipp merged 1 commit intoceph:masterfrom
Conversation
sebastian-philipp
left a comment
There was a problem hiding this comment.
I don't see a reason to only fix the format here.
| output += "\nAvailable: {0}".format(result['available']) | ||
| if 'reason' in result: | ||
| output += ' ({0})'.format(result['reason']) | ||
| return HandleCommandResult(stdout=output) |
There was a problem hiding this comment.
| return HandleCommandResult(stdout=output) | |
| return HandleCommandResult(retval=0 if avail else errno.EINVAL, stdout=output) |
There was a problem hiding this comment.
If we return a non zero exit code, we will always see the Error EINVAL: prefix, which for instance, makes the following output an invalid json:
# ceph orch status --format=json
Error EINVAL: {"available": false, "backend": "cephadm", "reason": "SSH keys not set. Use `ceph cephadm set-priv-key` and `ceph cephadm set-pub-key` or `ceph cephadm generate-key`"}
For this reason, let's keep exit code zero for now.
|
If you want, you can add a call to |
f8c0996 to
1fc6091
Compare
Done |
Fixes: https://tracker.ceph.com/issues/46233 Signed-off-by: Ricardo Marques <rimarques@suse.com>
1fc6091 to
83ff831
Compare
With this PR, it's now possible to specify
--formatonceph orch statuscommand, e.g.:Fixes: https://tracker.ceph.com/issues/46233
Signed-off-by: Ricardo Marques rimarques@suse.com
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard backendjenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume tox