Bug 1417732

Summary: python-demjson in CentOS 7 exits 0 on errors
Product: [Fedora] Fedora EPEL Reporter: Phil Porada <philporada>
Component: python-demjsonAssignee: Luke Macken <lewk>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: epel7CC: lewk, philporada, thomas.moschny
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: python-demjson-2.2.4-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-17 05:05:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Phil Porada 2017-01-30 19:27:30 UTC
Description of problem:
The provided yum python-demjson package is 2.2.2-1.el7 and will exit 0 on invalid json. The pip installed demjson package will be 2.2.4 and will exit 1 on the invalid json. The exit 1 is the correct thing that should happen.

Version-Release number of selected component (if applicable):
 python-demjson                                               noarch                                               2.2.2-1.el7                                                 epel                                               148 k
Linux default-centos-7.vagrantup.com 3.10.0-514.2.2.el7.x86_64 #1 SMP Tue Dec 6 23:06:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux


How reproducible:
Everytime

Steps to Reproduce:
1. yum install -y epel-release
2. yum update -y epel-release
3. yum install -y python-demjson python-pip
4. Lint some invalid json
5. echo $?
6. yum erase -y python-demjson
7. pip install demjson
8. Lint the same invalid json
9. echo $?

Actual results:
[root@default-centos-7 ~]# jsonlint /etc/sensu/uchiwa.json 
/etc/sensu/uchiwa.json:22:12: Error: Values must be separated by a comma
   |  At line 22, column 12, offset 523
   |  Object started at line 18, column 16, offset 414
/etc/sensu/uchiwa.json:27:12: Error: Values must be separated by a comma
   |  At line 27, column 12, offset 680
   |  Object started at line 23, column 26, offset 567
/etc/sensu/uchiwa.json: has errors
[root@default-centos-7 ~]# echo $?
0


Expected results:
[root@default-centos-7 ~]# jsonlint /etc/sensu/uchiwa.json 
/etc/sensu/uchiwa.json:22:12: Error: Values must be separated by a comma
   |  At line 22, column 12, offset 523
   |  Object started at line 18, column 16, offset 414
/etc/sensu/uchiwa.json:27:12: Error: Values must be separated by a comma
   |  At line 27, column 12, offset 680
   |  Object started at line 23, column 26, offset 567
/etc/sensu/uchiwa.json: has errors
[root@default-centos-7 ~]# echo $?
1


Additional info

Comment 1 Fedora Update System 2021-02-02 23:28:44 UTC
FEDORA-EPEL-2021-769ea26237 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2021-769ea26237

Comment 2 Fedora Update System 2021-02-03 02:38:25 UTC
FEDORA-EPEL-2021-769ea26237 has been pushed to the Fedora EPEL 7 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2021-769ea26237

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 3 Fedora Update System 2021-02-17 05:05:58 UTC
FEDORA-EPEL-2021-769ea26237 has been pushed to the Fedora EPEL 7 stable repository.
If problem still persists, please make note of it in this bug report.