summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-07-31 14:59:59 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-08-06 10:24:26 (GMT)
commit546c32753b2f0c2174c360ba83a7d2f7ffbb33f7 (patch)
tree85adaffbf373b0c2d4c94e9b8fba7ef9835ccd3b /meta/lib/oe
parentd9cb21854b139e9f8620ee256a3957db542494da (diff)
downloadpoky-546c32753b2f0c2174c360ba83a7d2f7ffbb33f7.tar.gz
classes/lib: Remove bb.build.FuncFailed
Whilst seemingly a good idea, this exception doesn't really serve any purpose that bb.fatal() doesn't cover. Wrapping exceptions within exceptions isn't pythonic. Its not used in many places, lets clean up those and remove usage of it entirely. It may ultimately be dropped form bitbake entirely. (From OE-Core rev: efe87ce4b2154c6f1c591ed9d8f770c229b044ad) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/gpg_sign.py5
-rw-r--r--meta/lib/oe/useradd.py2
-rw-r--r--meta/lib/oe/utils.py2
3 files changed, 4 insertions, 5 deletions
diff --git a/meta/lib/oe/gpg_sign.py b/meta/lib/oe/gpg_sign.py
index 2fd8c3b..d762480 100644
--- a/meta/lib/oe/gpg_sign.py
+++ b/meta/lib/oe/gpg_sign.py
@@ -89,8 +89,7 @@ class LocalSigner(object):
89 (_, stderr) = job.communicate(passphrase.encode("utf-8")) 89 (_, stderr) = job.communicate(passphrase.encode("utf-8"))
90 90
91 if job.returncode: 91 if job.returncode:
92 raise bb.build.FuncFailed("GPG exited with code %d: %s" % 92 bb.fatal("GPG exited with code %d: %s" % (job.returncode, stderr.decode("utf-8")))
93 (job.returncode, stderr.decode("utf-8")))
94 93
95 except IOError as e: 94 except IOError as e:
96 bb.error("IO error (%s): %s" % (e.errno, e.strerror)) 95 bb.error("IO error (%s): %s" % (e.errno, e.strerror))
@@ -108,7 +107,7 @@ class LocalSigner(object):
108 ver_str = subprocess.check_output(cmd).split()[2].decode("utf-8") 107 ver_str = subprocess.check_output(cmd).split()[2].decode("utf-8")
109 return tuple([int(i) for i in ver_str.split("-")[0].split('.')]) 108 return tuple([int(i) for i in ver_str.split("-")[0].split('.')])
110 except subprocess.CalledProcessError as e: 109 except subprocess.CalledProcessError as e:
111 raise bb.build.FuncFailed("Could not get gpg version: %s" % e) 110 bb.fatal("Could not get gpg version: %s" % e)
112 111
113 112
114 def verify(self, sig_file): 113 def verify(self, sig_file):
diff --git a/meta/lib/oe/useradd.py b/meta/lib/oe/useradd.py
index bedfe0e..8fc7756 100644
--- a/meta/lib/oe/useradd.py
+++ b/meta/lib/oe/useradd.py
@@ -14,7 +14,7 @@ class myArgumentParser(argparse.ArgumentParser):
14 error(message) 14 error(message)
15 15
16 def error(self, message): 16 def error(self, message):
17 raise bb.build.FuncFailed(message) 17 bb.fatal(message)
18 18
19def split_commands(params): 19def split_commands(params):
20 params = re.split('''[ \t]*;[ \t]*(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', params.strip()) 20 params = re.split('''[ \t]*;[ \t]*(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', params.strip())
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index d686ce1..652b2be 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -486,7 +486,7 @@ def write_ld_so_conf(d):
486 f.write(d.getVar("base_libdir") + '\n') 486 f.write(d.getVar("base_libdir") + '\n')
487 f.write(d.getVar("libdir") + '\n') 487 f.write(d.getVar("libdir") + '\n')
488 488
489class ImageQAFailed(bb.build.FuncFailed): 489class ImageQAFailed(Exception):
490 def __init__(self, description, name=None, logfile=None): 490 def __init__(self, description, name=None, logfile=None):
491 self.description = description 491 self.description = description
492 self.name = name 492 self.name = name