Bug 966980

Summary: backup.sh return code always 0 even on error
Product: Red Hat Enterprise Virtualization Manager Reporter: Harald Klein <hklein>
Component: ovirt-engineAssignee: Eli Mesika <emesika>
Status: CLOSED ERRATA QA Contact: Lukas Svaty <lsvaty>
Severity: high Docs Contact:
Priority: high    
Version: 3.1.0CC: acathrow, emesika, iheim, jkt, lpeer, pstehlik, Rhev-m-bugs, yeylon, yzaslavs
Target Milestone: ---   
Target Release: 3.3.0   
Hardware: All   
OS: Linux   
Whiteboard: infra
Fixed In Version: is9 Doc Type: Bug Fix
Doc Text:
--no tech note required
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-21 17:22:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Harald Klein 2013-05-24 12:51:03 UTC
Description of problem:

backup.sh always returns 0, even when the pg_dump fails

Version-Release number of selected component (if applicable):

3.1

How reproducible:



Steps to Reproduce:
1. /usr/share/ovirt-engine/dbscripts/backup.sh -s localhost -p 5432 -d notexistingdb -u postgres -l /var/lib/ovirt-engine/backups
2. echo $?

Actual results:

0

Expected results:

1

Additional info:

the culprit is here:
[…]

if [ $? -eq 0 ];then
    echo "Backup of database $DATABASE to $file completed."
    exit 0
else
    usage
    exit 1
fi
[…]
it never reaches "exit 1" in the else branch, as the "usage" function exits with 0 itself

Comment 1 Eli Mesika 2013-08-01 11:19:55 UTC
fixed in commit: 78dca85

Comment 3 Charlie 2013-11-28 00:10:52 UTC
This bug is currently attached to errata RHEA-2013:15231. If this change is not to be documented in the text for this errata please either remove it from the errata, set the requires_doc_text flag to minus (-), or leave a "Doc Text" value of "--no tech note required" if you do not have permission to alter the flag.

Otherwise to aid in the development of relevant and accurate release documentation, please fill out the "Doc Text" field above with these four (4) pieces of information:

* Cause: What actions or circumstances cause this bug to present.
* Consequence: What happens when the bug presents.
* Fix: What was done to fix the bug.
* Result: What now happens when the actions or circumstances above occur. (NB: this is not the same as 'the bug doesn't present anymore')

Once filled out, please set the "Doc Type" field to the appropriate value for the type of change made and submit your edits to the bug.

For further details on the Cause, Consequence, Fix, Result format please refer to:

https://bugzilla.redhat.com/page.cgi?id=fields.html#cf_release_notes 

Thanks in advance.

Comment 4 errata-xmlrpc 2014-01-21 17:22:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2014-0038.html