Project

General

Profile

Actions

Bug #36329

closed

format=json reports a different exit code than plain format

Added by Sébastien Han over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

It is tremendously confusing to see that plain and json output report a different return code, see the following example:

[root@osd0 ~]# ceph-volume lvm list /dev/sdb ; echo $?
No valid Ceph devices found
1
[root@osd0 ~]# ceph-volume lvm list /dev/sdb --format=json ; echo $?
{}
0
Actions #1

Updated by Alfredo Deza over 5 years ago

This is on purpose, to aid tooling like ceph-ansible, so that non-zero exit statuses don't need to be ignored.

I agree that this might be confusing for a user, but this is purposely set this way to avoid ignore_errors: True

Actions #3

Updated by Sébastien Han over 5 years ago

Fair enough. Thanks, we can close this.

Actions #4

Updated by Alfredo Deza over 5 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF