summaryrefslogtreecommitdiffstats
path: root/meta/classes/syslinux.bbclass
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2016-10-01 04:46:56 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-10-04 16:29:04 +0100
commit46398106efceba33715f9e6910b965629306fbdc (patch)
tree554859f8ff98be7627bd83e954f161d2061a0240 /meta/classes/syslinux.bbclass
parent103ab2d8105101ae1dd742d4fcd57d40d3ab2da3 (diff)
downloadpoky-46398106efceba33715f9e6910b965629306fbdc.tar.gz
syslinux.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to perceived complexity and cargo culting. Motivating quote below: < kergoth> the *original* intent was for the function/task to error via whatever appropriate means, bb.fatal, whatever, and funcfailed was what you'd catch if you were calling exec_func/exec_task. that is, it's what those functions raise, not what metadata functions should be raising < kergoth> it didn't end up being used that way < kergoth> but there's really never a reason to raise it yourself FuncFailed.__init__ takes a 'name' argument rather than a 'msg' argument, which also shows that the original purpose got lost. (From OE-Core rev: cca772ecf0adafbd767974add27ada125aae5269) Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/syslinux.bbclass')
-rw-r--r--meta/classes/syslinux.bbclass8
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/classes/syslinux.bbclass b/meta/classes/syslinux.bbclass
index 9b0c2c7fc6..7778fd708f 100644
--- a/meta/classes/syslinux.bbclass
+++ b/meta/classes/syslinux.bbclass
@@ -100,12 +100,12 @@ python build_syslinux_cfg () {
100 100
101 cfile = d.getVar('SYSLINUX_CFG', True) 101 cfile = d.getVar('SYSLINUX_CFG', True)
102 if not cfile: 102 if not cfile:
103 raise bb.build.FuncFailed('Unable to read SYSLINUX_CFG') 103 bb.fatal('Unable to read SYSLINUX_CFG')
104 104
105 try: 105 try:
106 cfgfile = open(cfile, 'w') 106 cfgfile = open(cfile, 'w')
107 except OSError: 107 except OSError:
108 raise bb.build.FuncFailed('Unable to open %s' % (cfile)) 108 bb.fatal('Unable to open %s' % cfile)
109 109
110 cfgfile.write('# Automatically created by OE\n') 110 cfgfile.write('# Automatically created by OE\n')
111 111
@@ -160,7 +160,7 @@ python build_syslinux_cfg () {
160 160
161 overrides = localdata.getVar('OVERRIDES', True) 161 overrides = localdata.getVar('OVERRIDES', True)
162 if not overrides: 162 if not overrides:
163 raise bb.build.FuncFailed('OVERRIDES not defined') 163 bb.fatal('OVERRIDES not defined')
164 164
165 localdata.setVar('OVERRIDES', label + ':' + overrides) 165 localdata.setVar('OVERRIDES', label + ':' + overrides)
166 bb.data.update_data(localdata) 166 bb.data.update_data(localdata)
@@ -172,7 +172,7 @@ python build_syslinux_cfg () {
172 172
173 root= d.getVar('SYSLINUX_ROOT', True) 173 root= d.getVar('SYSLINUX_ROOT', True)
174 if not root: 174 if not root:
175 raise bb.build.FuncFailed('SYSLINUX_ROOT not defined') 175 bb.fatal('SYSLINUX_ROOT not defined')
176 176
177 for btype in btypes: 177 for btype in btypes:
178 cfgfile.write('LABEL %s%s\nKERNEL /vmlinuz\n' % (btype[0], label)) 178 cfgfile.write('LABEL %s%s\nKERNEL /vmlinuz\n' % (btype[0], label))