Bug 447973

Summary: running ipa-server-install with bad options produces a 0 return code
Product: [Retired] freeIPA Reporter: Michael Gregg <mgregg>
Component: ipa-serverAssignee: Rob Crittenden <rcritten>
Status: CLOSED ERRATA QA Contact: Chandrasekar Kannan <ckannan>
Severity: medium Docs Contact:
Priority: high    
Version: unspecifiedCC: benl
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: freeipa-2.0.0-1.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 429034    
Attachments:
Description Flags
Fix up function return values so we can return 1 on an installation error. none

Description Michael Gregg 2008-05-22 18:11:15 UTC
Description of problem:
running ipa-server-install with bad options produces a zero return code

Version-Release number of selected component (if applicable):
build from 5-22-08

How reproducible:
always

Steps to Reproduce:
1.run /usr/sbin/ipa-server-install -U --hostname=dhcp-114 -r SJCTEST.REDHAT.COM
-p Secret123 -P Secret123 -a Secret123 --setup-bind -u admin -d
2.
3.
  
Actual results:
ipa server install produces a error message, and exits with a 0 return code.

Expected results:
The return code to not be 0.

Additional info:

Comment 1 Rob Crittenden 2008-05-22 18:20:15 UTC
What is the bad option in this command-line? It looks ok to me. The hostname is
probably not going to work but that is not a bad option.

Comment 2 Michael Gregg 2008-05-22 18:47:57 UTC
The bad option is the hostname. It's not a full hostname. 

So when ipa-server-install hits a ERROR, I'd like to see a non-zero result. 


This is the current output of that string, notice the return code at the bottom:

[root@dhcp-114 tmp]# /usr/sbin/ipa-server-install -U --hostname=dhcp-114 -r
SJCTEST.REDHAT.COM -p Secret123 -P Secret123 -a Secret123 --setup-bind -u admin -d

The log file for this installation can be found in /var/log/ipaserver-install.log
root        : DEBUG    Loading Index file from
'/var/lib/ipa/sysrestore/sysrestore.index'
==============================================================================
This program will setup the IPA Server.

This includes:
  * Configure the Network Time Daemon (ntpd)
  * Create and configure an instance of Directory Server
  * Create and configure a Kerberos Key Distribution Center (KDC)
  * Configure Apache (httpd)
  * Configure TurboGears

To accept the default shown in brackets, press the Enter key.

root        : DEBUG    Loading StateFile from
'/var/lib/ipa/sysrestore/sysrestore.state'
root        : DEBUG    Loading Index file from
'/var/lib/ipa/sysrestore/sysrestore.index'
root        : ERROR    Invalid hostname: dhcp-114



Return code:

[root@dhcp-114 tmp]# echo $?
0



Comment 3 Rob Crittenden 2008-05-22 19:20:51 UTC
Created attachment 306415 [details]
Fix up function return values so we can return 1 on an installation error.

Comment 4 Rob Crittenden 2008-05-22 20:38:04 UTC
ipa-1-0: 4a1862075e88cb48f226bb1c1b575e9484bdd845
master: 927447b144bbe0afd1d099a71dd482f61b431749

Comment 6 Michael Gregg 2008-11-20 00:21:32 UTC
ipa-server-install -U --hostname=BOGUSNAME -r BOGUSRELM -p Secret123 -P Secret123 -a Secret123 --setup-bind -u admin -d
+ ssh root.sjc2.redhat.com ipa-server-install -U --hostname=BOGUSNAME -r BOGUSRELM -p Secret123 -P Secret123 -a Secret123 --setup-bind -u admin -d
root        : DEBUG    Loading Index file from '/var/lib/ipa/sysrestore/sysrestore.index'

The log file for this installation can be found in /var/log/ipaserver-install.log
==============================================================================
This program will setup the IPA Server.

This includes:
  * Configure the Network Time Daemon (ntpd)
  * Create and configure an instance of Directory Server
  * Create and configure a Kerberos Key Distribution Center (KDC)
  * Configure Apache (httpd)
  * Configure TurboGears
  * Configure DNS (bind)

To accept the default shown in brackets, press the Enter key.

root        : ERROR    Invalid hostname: BOGUSNAME

+ ret=1


Verified against:
1.1.0-2.20081119.el5ipa