Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write migrated config to disk in Config.from_file #3797

Merged
merged 1 commit into from
Feb 24, 2020

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Feb 24, 2020

Fixes #3790 and supersedes #3792

When an existing configuration file with an outdated schema was loaded
from disk through Config.from_file, as happens in the initialization
call of aiida.manage.configuration.load_config, the content was
properly migrated in memory but the changes were not written to file.
This caused the migration to be performed each time.

When an existing configuration file with an outdated schema was loaded
from disk through `Config.from_file`, as happens in the initialization
call of `aiida.manage.configuration.load_config`, the content was
properly migrated in memory but the changes were not written to file.
This caused the migration to be performed each time.
@sphuber sphuber requested a review from greschd February 24, 2020 11:38
Copy link
Member

@greschd greschd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff! I assume you checked that the test fails without the config.store()?

@sphuber
Copy link
Contributor Author

sphuber commented Feb 24, 2020

Good stuff! I assume you checked that the test fails without the config.store()?

You assume correctly 😉

@sphuber sphuber merged commit 2f9224a into aiidateam:develop Feb 24, 2020
@sphuber sphuber deleted the fix_3790_config_migration_store branch February 24, 2020 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AiiDA fails to migrate an old config.json file.
2 participants