summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/gpg_sign.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-07-31 15:59:59 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-08-06 11:24:26 +0100
commit546c32753b2f0c2174c360ba83a7d2f7ffbb33f7 (patch)
tree85adaffbf373b0c2d4c94e9b8fba7ef9835ccd3b /meta/lib/oe/gpg_sign.py
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/gpg_sign.py')
-rw-r--r--meta/lib/oe/gpg_sign.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/meta/lib/oe/gpg_sign.py b/meta/lib/oe/gpg_sign.py
index 2fd8c3b1ac..d7624804d5 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):