Bug 1351718

Summary: osinfo-query does not return 1 when no matches found, as it claims
Product: [Community] Virtualization Tools Reporter: Adam Williamson <awilliam>
Component: libosinfoAssignee: Matthias Clasen <mclasen>
Status: CLOSED UPSTREAM QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: berrange, cfergeau, crobinso, fidencio
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-16 21:39:21 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 Adam Williamson 2016-06-30 16:03:45 UTC
'man osinfo-query' claims:

"The exit status will be 0 if matching entries were found, or 1 if not matches were found"

However:

[adamw@adam tools (relabel-permissive %)]$ rpm -q libosinfo
libosinfo-0.3.0-2.fc24.x86_64
[adamw@adam tools (relabel-permissive %)]$ osinfo-query os short-id=fedora24
 Short ID             | Name                                               | Version  | ID                                      
----------------------+----------------------------------------------------+----------+-----------------------------------------
[adamw@adam tools (relabel-permissive %)]$ echo $?
0

Comment 1 Fabiano FidĂȘncio 2016-06-30 17:05:54 UTC
Patch sent to the ML:
https://www.redhat.com/archives/libosinfo/2016-June/msg00066.html

Comment 3 Cole Robinson 2017-02-16 21:39:21 UTC
commit fbe3dff28709943dcb86af433370371fe6ff7fe2
Author: Fabiano FidĂȘncio <fidencio>
Date:   Thu Jun 30 18:59:11 2016 +0200

    osinfo-query: return failure when no matches are found