Adapt agama config to return error code when no validates#3304
Merged
Adapt agama config to return error code when no validates#3304
Conversation
imobachgs
approved these changes
Mar 19, 2026
Contributor
imobachgs
left a comment
There was a problem hiding this comment.
In general, it looks good. Please, remove the reference to InstallSettings.
imobachgs
approved these changes
Mar 20, 2026
teclator
added a commit
that referenced
this pull request
Mar 23, 2026
…3310) Same than #3304 but for SLE-16 In contrary to SLE-16.1, in SLE-16 the `agama config load` returns 1 in both cases when there is no product but continues otherwise. ## Tests - *Tested manually* ### agama config validate ```bash agama:~ # agama_not_fix/agama config validate profile.json || echo $? ✗ The profile is not valid. Please, check the following errors: * Additional properties are not allowed ('ID' was unexpected). /product * "id" is a required property. /product agama:~ # agama_fix/agama config validate profile.json || echo $? ✗ The profile is not valid. Please, check the following errors: * Additional properties are not allowed ('ID' was unexpected). /product * "id" is a required property. /product The profile is not valid 1 ``` ### agama config load ```bash agama:~ # agama_not_fix/agama config load profile.json || echo $? ✗ The profile is not valid. Please, check the following errors: * Additional properties are not allowed ('ID' was unexpected). /product * "id" is a required property. /product Cannot proceed with profile without specified product 1 agama:~ # agama_fix/agama config load profile.json || echo $? ✗ The profile is not valid. Please, check the following errors: * Additional properties are not allowed ('ID' was unexpected). /product * "id" is a required property. /product The profile is not valid 1 agama:~ # agama_not_fix/agama config load profile.json || echo $? ✗ The profile is not valid. Please, check the following errors: * Additional properties are not allowed ('test' was unexpected). [1/2] Analyze disks [2/2] Configure software agama:~ # nmcli c NAME UUID TYPE DEVICE Wired connection 1 91b9fecf-4020-35ec-97f8-d8e2cdcff413 ethernet enp1s0 Wired connection 2 12b49824-ddaa-3f0f-a73f-ec0f1ccd12ae ethernet enp2s0 Wired connection 3 b33b1b08-3513-3155-b8b4-16ceba7ee8bd ethernet enp3s0 lo 567dce11-cedd-4227-b2a5-d249da7d82d1 loopback lo agama:~ # cat profile.json | jq ".network .connections" [ { "id": "Wired connection 3", "status": "removed" } ] agama:~ # agama_fix/agama config load profile.json || echo $? ✗ The profile is not valid. Please, check the following errors: * Additional properties are not allowed ('test' was unexpected). The profile is not valid 1 agama:~ # agama_not_fix/agama config load profile.json || echo $? ✗ The profile is not valid. Please, check the following errors: * Additional properties are not allowed ('test' was unexpected). agama:~ # nmcli c NAME UUID TYPE DEVICE Wired connection 1 91b9fecf-4020-35ec-97f8-d8e2cdcff413 ethernet enp1s0 Wired connection 2 12b49824-ddaa-3f0f-a73f-ec0f1ccd12ae ethernet enp2s0 lo 567dce11-cedd-4227-b2a5-d249da7d82d1 loopback lo º ``` ### agama config generate ```bash agama:~ # agama_not_fix/agama config generate profile.jsonnet || echo $? { "hostname": { "static": "Agama" }, "product": { "ID": "Tumbleweed" }, "scripts": { "post": [ { "chroot": true, "content": "#!/usr/bin/env bash\necho 'PermitRootLogin yes' > /etc/ssh/sshd_config.d/root.conf\nsystemctl enable sshd\n", "name": "enable root login" } ] } } ✗ The profile is not valid. Please, check the following errors: * Additional properties are not allowed ('ID' was unexpected). /product * "id" is a required property. /product agama:~ # agama_fix/agama config generate profile.jsonnet || echo $? { "hostname": { "static": "Agama" }, "product": { "ID": "Tumbleweed" }, "scripts": { "post": [ { "chroot": true, "content": "#!/usr/bin/env bash\necho 'PermitRootLogin yes' > /etc/ssh/sshd_config.d/root.conf\nsystemctl enable sshd\n", "name": "enable root login" } ] } } ✗ The profile is not valid. Please, check the following errors: * Additional properties are not allowed ('ID' was unexpected). /product * "id" is a required property. /product The profile is not valid 1 ``` Also tested with edit ```bash agama:~/agama_fix # agama config edit ✗ The profile is not valid. Please, check the following errors: * Additional properties are not allowed ('test' was unexpected). agama:~/agama_fix # echo $? 0 agama:~/agama_fix # ./agama config edit ✗ The profile is not valid. Please, check the following errors: * Additional properties are not allowed ('test' was unexpected). The profile is not valid agama:~/agama_fix # echo $? 1 ```
mvidner
added a commit
that referenced
this pull request
Mar 27, 2026
invalid profile now returns an error exit code, as fixed in #3304
mvidner
added a commit
that referenced
this pull request
Mar 27, 2026
## Problem - invalid profile now returns an error exit code, as fixed in #3304 ## Solution - tell Cheetah to allow that exit code ## Testing - this **is** a test, run daily on schedule ## Screenshots No ## Documentation No
Merged
imobachgs
added a commit
that referenced
this pull request
Apr 14, 2026
Prepare to release version 20. * #3294 * #3295 * #3296 * #3297 * #3298 * #3299 * #3300 * #3301 * #3302 * #3303 * #3304 * #3305 * #3306 * #3307 * #3308 * #3309 * #3310 * #3311 * #3312 * #3313 * #3315 * #3316 * #3317 * #3318 * #3319 * #3320 * #3322 * #3323 * #3325 * #3326 * #3327 * #3329 * #3330 * #3331 * #3333 * #3334 * #3336 * #3338 * #3339 * #3342 * #3343 * #3349 * #3351 * #3352 * #3353 * #3354 * #3356 * #3357 * #3358 * #3359 * #3360 * #3361 * #3362 * #3363 * #3364 * #3365 * #3366 * #3367 * #3368 * #3371 * #3372 * #3373 * #3375 * #3376 * #3378 * #3379 * #3380 * #3381 * #3382 * #3385 * #3386
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When running
agama config load,agama config generateoragama config validateit always returns0even when the profile is invalid.Solution
Return Err (
return code 1) in case of invalid profile.Testing
agama config generate
agama config load
agama config validate