Bug 1747202

Summary: appliance_console_cli returns 0 on failure
Product: Red Hat CloudForms Management Engine Reporter: Tuan <tuado>
Component: ApplianceAssignee: Joe Vlcek <jvlcek>
Status: CLOSED NOTABUG QA Contact: Devidas Gaikwad <dgaikwad>
Severity: medium Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: medium    
Version: 5.10.8CC: abellott, akarol, dmetzger, jvlcek, obarenbo, smallamp
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.12.0   
Hardware: All   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1753687 1767774 (view as bug list) Environment:
Last Closed: 2020-06-10 12:31:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1753687, 1767774    

Description Tuan 2019-08-29 22:14:33 UTC
Description of problem:
When running appliance_console_cli to configure a database, if the database is already configured it will recognize that the DB is already configured but returns 0 as though the command succeeded.  Scripts and/or automation that rely on return value will be misinformed as to the failure of the DB configuration and unable to take action to handle the failure.

Command being run: /opt/rh/cfme-gemset/bin/appliance_console_cli -i -b /dev/sdb -S -d ${db_name} -U ${db_root} -p '${db_pass}'
Hostname, timezone, and v2_key are already set.


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

How reproducible:


Steps to Reproduce:
1.Log into AP
2.Run command opt/rh/cfme-gemset/bin/appliance_console_cli -i -b /dev/sdb -S -d ${db_name} -U ${db_root} -p '${db_pass}'
3. Result: Hostname, timezone, and v2_key are already set


Actual results:


Expected results:


Additional info:

Comment 3 CFME Bot 2019-09-17 13:51:42 UTC
New commit detected on ManageIQ/manageiq-appliance_console/master:

https://github.com/ManageIQ/manageiq-appliance_console/commit/372f78f5a4e67b266a477e47860e0e4532f6510f
commit 372f78f5a4e67b266a477e47860e0e4532f6510f
Author:     Joe VLcek <jvlcek>
AuthorDate: Fri Sep 13 17:00:45 2019 -0400
Commit:     Joe VLcek <jvlcek>
CommitDate: Fri Sep 13 17:00:45 2019 -0400

    Exit with non-zero when database activation fails

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1747202

 lib/manageiq/appliance_console/cli.rb | 5 +-
 spec/cli_spec.rb | 125 +-
 2 files changed, 69 insertions(+), 61 deletions(-)

Comment 5 CFME Bot 2019-09-19 17:30:52 UTC
New commit detected on ManageIQ/manageiq-appliance/master:

https://github.com/ManageIQ/manageiq-appliance/commit/dce8a03b12455adf725992035ae90c3a73514edb
commit dce8a03b12455adf725992035ae90c3a73514edb
Author:     Joe VLcek <jvlcek>
AuthorDate: Thu Sep 19 13:22:38 2019 -0400
Commit:     Joe VLcek <jvlcek>
CommitDate: Thu Sep 19 13:22:38 2019 -0400

    Update dependency on manageiq-appliance_console

    https://bugzilla.redhat.com/show_bug.cgi?id=1747202

 manageiq-appliance-dependencies.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)