Bug 1160091

Summary: kickstart %post scriptlet has invalid syntax if custom snippet is empty
Product: [Retired] Beaker Reporter: Dan Callaghan <dcallagh>
Component: generalAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.18CC: aigao, asaha, dcallagh, dowang
Target Milestone: 19.0Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-25 07:18:19 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 Dan Callaghan 2014-11-04 02:32:17 UTC
Description of problem:
If the admin has a custom 'readahead_sysconfig' snippet which is empty (because they want to avoid Beaker's default readahead fiddling in their environment), as of Beaker 0.18 this will result in invalid syntax in the kickstart %post.

Release number of selected component (if applicable):
0.18.2

How reproducible:
with admin access

Steps to Reproduce:
1. Create empty file /etc/beaker/snippets/readahead_sysconfig
2. Run a job

Actual results:
Kickstart %post contains:

if [ -f /etc/sysconfig/readahead ] ; then
fi

which is a syntax error, so %post script does not work properly.

Expected results:
No syntax error, statement should have no effect if the snippet is empty.

Additional info:
Some other snippets suffer the same problem, need to audit to find which ones.

Thanks to Jun'ichi Nomura for the original report: http://article.gmane.org/gmane.comp.systems.beaker.devel/1118

Comment 1 Dan Callaghan 2014-11-04 02:34:49 UTC
virt_console_post is the only other problematic one.

Comment 2 Dan Callaghan 2014-11-04 02:44:31 UTC
http://gerrit.beaker-project.org/3458

Comment 5 Dan Callaghan 2014-11-11 03:56:50 UTC
We are not planning to do any more maintenance releases for the 0.18.x series, the next release will be 19.0.

Comment 6 Dan Callaghan 2014-11-25 07:18:19 UTC
Beaker 19.0 has been released.