If the user mistypes a build type name, that leads to a raw unhandled exception:
$ sudo ./build-vyos-image --build-type no-such-type generic I: Checking if packages required for VyOS image build are installed I: using build flavors directory data/build-flavors Traceback (most recent call last): File "/vyos/./build-vyos-image", line 295, in <module> with open(make_toml_path(defaults.BUILD_TYPES_DIR, pre_build_config["build_type"]), 'rb') as f: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: 'data/build-types/no-such-type.toml'
A more user-friendly error could be nice.
Arguably, we should also get rid of sys.exit() calls rather than multiply them: see T8194.