overall better handling and usage of exceptions
All checks were successful
bundlewrap/pipeline/head This commit looks good
All checks were successful
bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
5d5930265a
commit
f8bbe00d47
21 changed files with 57 additions and 28 deletions
|
@ -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 = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue