Bug 684103

Summary: When kickstart is rendered, an runtime execution error occurs when running insmod /lib/ext4.o
Product: [Community] Spacewalk Reporter: Marcelo Moreira de Mello <mmello>
Component: ServerAssignee: Michael Mráka <mmraka>
Status: CLOSED NOTABUG QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: high Docs Contact:
Priority: medium    
Version: 1.4CC: mmello
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 684102 Environment:
Last Closed: 2011-03-11 05:53:56 UTC 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: 462714, 674675    

Description Marcelo Moreira de Mello 2011-03-11 05:47:38 UTC
+++ This bug was initially created as a clone of Bug #684102 +++

Description of problem:

When kickstart is rendered, an runtime execution error is found when running insmod /lib/ext4.o. Kickstart script is missing the syntax 'then'

Kickstart is rendered as below: 


%pre
echo "Saving RHN keys..." > /dev/ttyS0
SYSTEM_ID=/etc/sysconfig/rhn/systemid
rhn_keys_found=no

insmod /lib/jbd.o
insmod /lib/ext3.o

if [ -f /lib/ext4.o ];
    insmod /lib/ext4.o
fi

Version-Release number of selected component (if applicable):
Red Hat Satellite 5.4
Spacewalk 1.4 (Nightly)

How reproducible:
100%


Steps to Reproduce:
1. Create a kickstart
  
Actual results:

Kickstart is rendered with a error in syntax for Bash script: 

insmod /lib/jbd.o
insmod /lib/ext3.o

if [ -f /lib/ext4.o ];
    insmod /lib/ext4.o
fi


Expected results:

Kickstart executes with no errors: 

if [ -f /lib/ext4.o ]; then
    insmod /lib/ext4.o
fi


# if [ -f /lib/ext4.o ];then    insmod /lib/ext4.o; fi

Additional info:


=== Not Working

[root@server]# if [ -f /lib/ext4.o ];     insmod /lib/ext4.o; fi
bash: syntax error near unexpected token `fi'
[root@server]# echo $?
2

=== Working
[root@server]# if [ -f /lib/ext4.o ];then    insmod /lib/ext4.o; fi
[root@server]# echo $?
0

Comment 1 Marcelo Moreira de Mello 2011-03-11 05:53:56 UTC
Not a bug!

Closing!