overall better handling and usage of exceptions
All checks were successful
bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2021-04-02 18:57:13 +02:00
parent 5d5930265a
commit f8bbe00d47
Signed by: kunsi
GPG key ID: 12E3D2136B818350
21 changed files with 57 additions and 28 deletions

View file

@ -1,3 +1,5 @@
from bundlewrap.exceptions import BundleError
supported_os = {
'debian': {
10: 'buster',
@ -9,7 +11,10 @@ supported_os = {
},
}
assert supported_os[node.os][node.os_version[0]], '{}: OS {} {} is not supported by bundle:apt'.format(node.name, node.os, node.os_version)
try:
supported_os[node.os][node.os_version[0]]
except (KeyError, IndexError):
raise BundleError(f'{node.name}: OS {node.os} {node.os_version} is not supported by bundle:apt')
actions = {