Skip to content
Commit f82e2ef0 authored by Grzegorz Swiderski's avatar Grzegorz Swiderski Committed by Carles Cufí
Browse files

scripts: domains: Tighten up initialization



Do extra checks to reject inconsistent `domains.yaml` contents early:

   default: app
   build_dir: /path/to/build
   domains:
     - name: image_1
       build_dir: /path/to/build/image_1
     - name: image_2
       build_dir: /path/to/build/image_2
   flash_order:
     - image_1
     - image_2
     - unknown

This example lists "image_1" and "image_2" as known domains, but an
entry for the default "app" is missing, which should never be allowed.
A valid `domains.yaml` file shall also not contain extra domains under
`flash_order`, such as "unknown", which doesn't appear under `domains`.
Either of these cases can now be caught while initializing an instance
of the Domains class.

It follows that a valid `domains.yaml` file must always contain a list
of domains with at least one entry - the default image. Since `default`
is a required key in the YAML schema, `domains` should be required too.
Thus, empty lists will be rejected by pykwalify, so the questionable
warning for "no domains defined; this probably won't work" can be axed.

Fixes #63166

Signed-off-by: default avatarGrzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
parent 2f64ac9a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment