-
Notifications
You must be signed in to change notification settings - Fork 80
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
Informative errors on qiita_env #157
Conversation
@@ -142,6 +170,13 @@ def make_demo_environment(base_data_dir, base_work_dir, user, password, host): | |||
conn.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT) | |||
# Create the database | |||
cur = conn.cursor() | |||
# First check if the qiita_demo database already exists | |||
if _check_db_exists('qiita_demo', cur): | |||
raise QiitaEnvironmentError( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the script should error, it should just print a message saying that there's nothing to do and hinting to qiita_env drop_demo_env
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Would be cool to figure out a way to use click's progress bars, note that these are only available in click 2.0. |
Thanks @ElDeveloper I'll take a look tomorrow. I'm falling asleep... |
@@ -33,6 +34,21 @@ | |||
POPULATE_FP = get_support_file('populate_test_db.sql') | |||
|
|||
|
|||
def _check_db_exists(db, cursor): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sections validates all possible env in a specific way vs. querying a conf or something to know what are the possible env, which will make difficult to add/delete for good more environments, can you change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think done :P
@ElDeveloper see #161 |
Fixes #159 |
Fixes #157 |
Fixes #156 |
👍 if tests pass |
Informative errors on qiita_env
Fixes #140
I've also noticed that
qiita_env make_demo_env
now takes a while since it has to download the data files. Since this can be annoying to the user, I've added someprint
statements such that the user know what is the script doing. Here is an example: