Skip to content

Imported configuration values set via apply_default() are not recognized as modified, causing fallback to defaults during import #1110

Open

Description

@JedHawkins

Description:

When importing a Malcolm configuration file using install.py (e.g., with --import-malcolm-config-file), the configuration items present in the file are read and values are set via the apply_default() method in MalcolmConfig. However, these values are not marked as modified internally.

As a result, the import process treats these keys as missing and falls back to default values, logging warnings such as:

Configuration item not found in settings file, using default:
This behavior occurs even when importing a freshly exported default configuration file without any changes.

Steps to Reproduce:

Export the default configuration file using:

python3 ./scripts/install.py --export-malcolm-config-file default.json
Import the same file back with debug enabled:

python3 ./scripts/install.py --configure --non-interactive --import-malcolm-config-file default.json --debug
Observe warnings about configuration items not found and usage of defaults, despite the keys being present.

Expected Behavior:

Imported configuration values should be recognized as user-supplied (i.e., marked as modified) and not treated as missing or defaulted.

Root Cause (suggested):

The import code calls MalcolmConfig.apply_default(key, value) to set imported values, which does not mark the configuration items as modified. Instead, it should use a method like MalcolmConfig.set_value(key, value) that flags the keys as modified.

Suggested Fix:

Change the import logic to use set_value() (or equivalent) instead of apply_default() when applying user-imported configuration values.

Additional Information:

self.malcolm_config.apply_default(key, value)

Activity

  1. mmguero commented on Sep 2, 2026

    @mmguero
    Collaborator

    I'll have to talk to you about this, I use import-malcolm-config-file constantly and it imports the keys as I'd expect. Maybe the initial state you're starting from is different than mine.

  2. self-assigned this
    on Sep 2, 2026
  3. added
    install.pyRelating to the install.py configuration script
    bugSomething isn't working
    on Sep 2, 2026
  4. added this to the v26.09.0 milestone on Sep 2, 2026
  5. moved this to Triage in Malcolmon Sep 14, 2026
  6. modified the milestones: v26.09.0, v26.10.0 on Sep 22, 2026
  7. modified the milestones: v26.10.0, v26.11.0 on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinginstall.pyRelating to the install.py configuration script

Type

No type

Fields

No fields configured for issues without a type.

Projects

  • Status
    Triage

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions