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

differentiate quicksetup based on project folder #1901

Merged
merged 1 commit into from
Aug 23, 2018

Conversation

DropD
Copy link
Contributor

@DropD DropD commented Aug 23, 2018

Problem:

When using quicksetup with a custom location for the .aiida/ config folder, it might try to create and use an existing dbuser with a new password, causing naive use of quicksetup to fail.

Solution:

Add a uuid of the current AIIDA_PATH folder to the db user and db name during quicksetup.

@DropD DropD requested review from ltalirz and sphuber August 23, 2018 12:21
@DropD DropD force-pushed the quicksetup-aiida-path branch from 9fef0e3 to eb320df Compare August 23, 2018 12:22
@codecov-io
Copy link

codecov-io commented Aug 23, 2018

Codecov Report

Merging #1901 into develop will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1901      +/-   ##
===========================================
+ Coverage    66.82%   66.82%   +<.01%     
===========================================
  Files          320      320              
  Lines        32590    32592       +2     
===========================================
+ Hits         21778    21780       +2     
  Misses       10812    10812
Impacted Files Coverage Δ
aiida/cmdline/commands/cmd_quicksetup.py 86.74% <100%> (+0.32%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1400c4c...eb320df. Read the comment docs.


# default database user name is aiida_qs_<login-name>
# default password is random
dbuser = db_username or 'aiida_qs_' + osuser
dbuser = db_username or 'aiida_qs_' + osuser + '_' + aiida_base_dir_hash
Copy link
Member

Choose a reason for hiding this comment

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

I get that it makes sense to use a different DB for different config folders.
If the DB is already different, do we still need to append the hash to the username?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In fact the username is just as important: if it already exists (from another config.json), there is no way to know the password stored in the other config.json.

Copy link
Member

Choose a reason for hiding this comment

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

Ah right, I forgot that the user names are system-wide.

@DropD DropD force-pushed the quicksetup-aiida-path branch from eb320df to 8e4c01d Compare August 23, 2018 14:16
Copy link
Member

@ltalirz ltalirz left a comment

Choose a reason for hiding this comment

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

Alright with me - your choice whether you want to check with sebastiaan

@DropD DropD merged commit 4bb5940 into aiidateam:develop Aug 23, 2018
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.

4 participants