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

config migration: handle edge case #3585

Merged
merged 1 commit into from
Nov 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions aiida/manage/configuration/migrations/migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,17 @@ def _1_add_profile_uuid(config):
def _2_simplify_default_profiles(config):
"""
The concept of a different 'process' for a profile has been removed and as such the
default profiles key in the configuration no longer needs a value per process ('verdi', 'daemon')
We remove the dictionary 'default_profiles' and replace it with a simple value 'default_profile'
default profiles key in the configuration no longer needs a value per process ('verdi', 'daemon').
We remove the dictionary 'default_profiles' and replace it with a simple value 'default_profile'.
"""
from aiida.manage.configuration import PROFILE

default_profiles = config.pop('default_profiles', None)

if default_profiles:
if default_profiles and 'daemon' in default_profiles:
config['default_profile'] = default_profiles['daemon']
elif default_profiles and 'verdi' in default_profiles:
config['default_profile'] = default_profiles['verdi']
elif PROFILE is not None:
config['default_profile'] = PROFILE.name

Expand Down