summaryrefslogtreecommitdiff
path: root/scripts/build-vyos-image
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2024-03-23 15:15:37 -0500
committerGitHub <noreply@github.com>2024-03-23 15:15:37 -0500
commitf08721e15bb4974fefe7dadb6a3d10774e9a301f (patch)
treef699cc747ea74337bfebf486390839a4ea834bf3 /scripts/build-vyos-image
parent70ac747b2889757e35ac2a90fd77cda9d4b97ebd (diff)
parentb35eb63db370e2ee9fc41af3ad1ccdc335bc4816 (diff)
downloadvyos-build-f08721e15bb4974fefe7dadb6a3d10774e9a301f.tar.gz
vyos-build-f08721e15bb4974fefe7dadb6a3d10774e9a301f.zip
Merge pull request #537 from dmbaturin/veps
build flavors: T3664: reimplement Dell VEP flavors using the new system
Diffstat (limited to 'scripts/build-vyos-image')
-rwxr-xr-xscripts/build-vyos-image14
1 files changed, 11 insertions, 3 deletions
diff --git a/scripts/build-vyos-image b/scripts/build-vyos-image
index fb7eb540..3d287406 100755
--- a/scripts/build-vyos-image
+++ b/scripts/build-vyos-image
@@ -193,9 +193,17 @@ if __name__ == "__main__":
pre_build_config = merge_dicts({}, build_defaults)
flavor_config = {}
- with open(make_toml_path(defaults.BUILD_FLAVORS_DIR, args["build_flavor"]), 'rb') as f:
- flavor_config = tomli.load(f)
- pre_build_config = merge_dicts(flavor_config, pre_build_config)
+ build_flavor = args["build_flavor"]
+ try:
+ with open(make_toml_path(defaults.BUILD_FLAVORS_DIR, args["build_flavor"]), 'rb') as f:
+ flavor_config = tomli.load(f)
+ pre_build_config = merge_dicts(flavor_config, pre_build_config)
+ except FileNotFoundError:
+ print(f"E: Flavor '{build_flavor}' does not exist")
+ sys.exit(1)
+ except tomli.TOMLDecodeError as e:
+ print(f"E: Failed to parse TOML file for flavor '{build_flavor}': {e}")
+ sys.exit(1)
## Combine configs args > flavor > defaults
pre_build_config = merge_dicts(args, pre_build_config, skip_none=True)