summaryrefslogtreecommitdiffstats
path: root/meta/classes/gummiboot.bbclass
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2016-10-01 04:46:58 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-10-04 16:29:04 +0100
commitf13bd4b8e4202e29ce83ed842bb54b28a63c2d70 (patch)
tree1be660ca1b2d84f7b9847fc5014f74521e7a9d75 /meta/classes/gummiboot.bbclass
parentd11b51dfadf2a5cadcbfa3ee384776aba291ed9a (diff)
downloadpoky-f13bd4b8e4202e29ce83ed842bb54b28a63c2d70.tar.gz
gummiboot.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: f7c82acbac583c7838550175796a7aa697a5c7e0) Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/gummiboot.bbclass')
-rw-r--r--meta/classes/gummiboot.bbclass6
1 files changed, 3 insertions, 3 deletions
diff --git a/meta/classes/gummiboot.bbclass b/meta/classes/gummiboot.bbclass
index e6eba17da1..4f2dea6c3d 100644
--- a/meta/classes/gummiboot.bbclass
+++ b/meta/classes/gummiboot.bbclass
@@ -74,7 +74,7 @@ python build_efi_cfg() {
74 try: 74 try:
75 cfgfile = open(cfile, 'w') 75 cfgfile = open(cfile, 'w')
76 except OSError: 76 except OSError:
77 raise bb.build.FuncFailed('Unable to open %s' % (cfile)) 77 bb.fatal('Unable to open %s' % cfile)
78 78
79 cfgfile.write('# Automatically created by OE\n') 79 cfgfile.write('# Automatically created by OE\n')
80 cfgfile.write('default %s\n' % (labels.split()[0])) 80 cfgfile.write('default %s\n' % (labels.split()[0]))
@@ -90,14 +90,14 @@ python build_efi_cfg() {
90 90
91 overrides = localdata.getVar('OVERRIDES', True) 91 overrides = localdata.getVar('OVERRIDES', True)
92 if not overrides: 92 if not overrides:
93 raise bb.build.FuncFailed('OVERRIDES not defined') 93 bb.fatal('OVERRIDES not defined')
94 94
95 entryfile = "%s/%s.conf" % (s, label) 95 entryfile = "%s/%s.conf" % (s, label)
96 d.appendVar("GUMMIBOOT_ENTRIES", " " + entryfile) 96 d.appendVar("GUMMIBOOT_ENTRIES", " " + entryfile)
97 try: 97 try:
98 entrycfg = open(entryfile, "w") 98 entrycfg = open(entryfile, "w")
99 except OSError: 99 except OSError:
100 raise bb.build.FuncFailed('Unable to open %s' % (entryfile)) 100 bb.fatal('Unable to open %s' % entryfile)
101 localdata.setVar('OVERRIDES', label + ':' + overrides) 101 localdata.setVar('OVERRIDES', label + ':' + overrides)
102 bb.data.update_data(localdata) 102 bb.data.update_data(localdata)
103 103