diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2016-10-01 04:46:55 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-10-04 16:29:04 +0100 |
| commit | 103ab2d8105101ae1dd742d4fcd57d40d3ab2da3 (patch) | |
| tree | 34e9856115e9fff9ed524194c9c712a34f9e7e59 | |
| parent | 255f260675f36e7cd2326c5d156a15ebd551f564 (diff) | |
| download | poky-103ab2d8105101ae1dd742d4fcd57d40d3ab2da3.tar.gz | |
grub-efi.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: 48c4faa1d7117732974e51428f7ed2f62ad7e7bf)
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/classes/grub-efi.bbclass | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/classes/grub-efi.bbclass b/meta/classes/grub-efi.bbclass index 26ba8cefcb..17417ba5d9 100644 --- a/meta/classes/grub-efi.bbclass +++ b/meta/classes/grub-efi.bbclass | |||
| @@ -90,12 +90,12 @@ python build_efi_cfg() { | |||
| 90 | 90 | ||
| 91 | cfile = d.getVar('GRUB_CFG', True) | 91 | cfile = d.getVar('GRUB_CFG', True) |
| 92 | if not cfile: | 92 | if not cfile: |
| 93 | raise bb.build.FuncFailed('Unable to read GRUB_CFG') | 93 | bb.fatal('Unable to read GRUB_CFG') |
| 94 | 94 | ||
| 95 | try: | 95 | try: |
| 96 | cfgfile = open(cfile, 'w') | 96 | cfgfile = open(cfile, 'w') |
| 97 | except OSError: | 97 | except OSError: |
| 98 | raise bb.build.FuncFailed('Unable to open %s' % (cfile)) | 98 | bb.fatal('Unable to open %s' % cfile) |
| 99 | 99 | ||
| 100 | cfgfile.write('# Automatically created by OE\n') | 100 | cfgfile.write('# Automatically created by OE\n') |
| 101 | 101 | ||
| @@ -114,7 +114,7 @@ python build_efi_cfg() { | |||
| 114 | 114 | ||
| 115 | root = d.getVar('GRUB_ROOT', True) | 115 | root = d.getVar('GRUB_ROOT', True) |
| 116 | if not root: | 116 | if not root: |
| 117 | raise bb.build.FuncFailed('GRUB_ROOT not defined') | 117 | bb.fatal('GRUB_ROOT not defined') |
| 118 | 118 | ||
| 119 | if gfxserial == "1": | 119 | if gfxserial == "1": |
| 120 | btypes = [ [ " graphics console", "" ], | 120 | btypes = [ [ " graphics console", "" ], |
| @@ -127,7 +127,7 @@ python build_efi_cfg() { | |||
| 127 | 127 | ||
| 128 | overrides = localdata.getVar('OVERRIDES', True) | 128 | overrides = localdata.getVar('OVERRIDES', True) |
| 129 | if not overrides: | 129 | if not overrides: |
| 130 | raise bb.build.FuncFailed('OVERRIDES not defined') | 130 | bb.fatal('OVERRIDES not defined') |
| 131 | 131 | ||
| 132 | for btype in btypes: | 132 | for btype in btypes: |
| 133 | localdata.setVar('OVERRIDES', label + ':' + overrides) | 133 | localdata.setVar('OVERRIDES', label + ':' + overrides) |
